diff --git a/Cargo.toml b/Cargo.toml index 876e19d..4b82497 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,11 @@ homepage = "https://github.com/GyrosOfWar/youtube-dl-rs" categories = ["multimedia::video"] keywords = ["youtube-dl", "youtube"] +[features] +default = ["youtube-dl"] +youtube-dl = [] +yt-dlp = [] + [dependencies] serde = { version = "1.0.124", features = ["derive"] } serde_json = "1.0.64" diff --git a/src/model.rs b/src/model.rs index d52da76..ef780ee 100644 --- a/src/model.rs +++ b/src/model.rs @@ -35,7 +35,10 @@ pub struct Format { pub downloader_options: Option>, pub ext: Option, pub filesize: Option, + #[cfg(feature = "youtube-dl")] pub filesize_approx: Option, + #[cfg(feature = "yt-dlp")] + pub filesize_approx: Option, pub format: Option, pub format_id: Option, pub format_note: Option, @@ -209,7 +212,10 @@ pub struct SingleVideo { pub extractor: Option, pub extractor_key: Option, pub filesize: Option, + #[cfg(feature = "youtube-dl")] pub filesize_approx: Option, + #[cfg(feature = "yt-dlp")] + pub filesize_approx: Option, pub format: Option, pub format_id: Option, pub format_note: Option, @@ -314,4 +320,10 @@ pub enum Protocol { M3U8Native, #[serde(rename = "http_dash_segments")] HttpDashSegments, + #[cfg(feature = "yt-dlp")] + #[serde(rename = "mhtml")] + Mhtml, + #[cfg(feature = "yt-dlp")] + #[serde(rename = "https+https")] + HttpsHttps, }