| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A URL expansion engine that supports an extensive registry of shortening services. It combines fast domain detection with robust resolution strategies: HTTP redirect following, pattern-based extraction from intermediate HTML, and API-based expansion for shorteners that don’t emit standard 3xx redirects. Returns the canonical final URL with consistent error handling and configurable timeouts.
This module recognizes hundreds of popular URL shorteners and expands them to their true destination
urlexpand = "0.3.0"and then
use std::time::Duration;
use urlexpand::unshorten;
fn main() {
let url = "https://bit.ly/3alqLKi";
assert!(unshorten(url, Some(Duration::from_secs(10))).await.is_ok()); // with timeout
assert!(unshorten(url, None).await.is_ok()); // without timeout
}urlexpand = { version = "0.3.0", features = ["blocking"] }and then
use std::time::Duration;
use urlexpand::unshorten;
fn main() {
let url = "https://bit.ly/3alqLKi";
assert!(unshorten(url, Some(Duration::from_secs(10))).is_ok()); // with timeout
assert!(unshorten(url, None).is_ok()); // without timeout
}cargo run --example unshorten https://bit.ly/3alqLKiPlease feel free to contribute by making pull requests or even bug fixes.
Thanks in advance.
License: MIT
| Back | FazBrowse Home | New Git URL |