| Crates.io | video-url-validator |
| lib.rs | video-url-validator |
| version | 0.1.0 |
| created_at | 2025-08-22 10:48:33.03382+00 |
| updated_at | 2025-08-22 10:48:33.03382+00 |
| description | A Rust crate for validating video URLs from popular platforms (YouTube, Facebook, Vimeo, DailyMotion, Wistia) |
| homepage | https://github.com/LimaniBhavik/video-url-validator |
| repository | https://github.com/LimaniBhavik/video-url-validator |
| max_upload_size | |
| id | 1806187 |
| size | 23,367 |
A Rust crate for validating video URLs from popular platforms.
Add this to your Cargo.toml:
[dependencies]
video-url-validator = "0.1.0"
use video_url_validator::{VideoUrlValidator, VideoPlatform};
let validator = VideoUrlValidator::new();
// Validate specific platform
if validator.validate_youtube_video_url("https://youtube.com/watch?v=dQw4w9WgXcQ") {
println!("Valid YouTube URL!");
}
// Auto-detect platform
match validator.validate_video_url("https://vimeo.com/123456789") {
Some(platform) => println!("Valid {} URL!", platform.as_str()),
None => println!("Invalid or unsupported video URL"),
}
// Batch validation
let urls = ["https://youtube.com/watch?v=abc", "https://vimeo.com/123"];
let results = validator.validate_multiple(&urls);
cargo run --example basic_usage
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_youtube_validation
MIT License Copyright 2015 BhavikLimani
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.