Skip to content

Commit

Permalink
Merge pull request #19 from luqmanishere/master
Browse files Browse the repository at this point in the history
Add feature `yt-dlp` to support yt-dlp
  • Loading branch information
GyrosOfWar authored Dec 16, 2021
2 parents ef06868 + 6965278 commit a76a03c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ pub struct Format {
pub downloader_options: Option<BTreeMap<String, Value>>,
pub ext: Option<String>,
pub filesize: Option<f64>,
#[cfg(feature = "youtube-dl")]
pub filesize_approx: Option<String>,
#[cfg(feature = "yt-dlp")]
pub filesize_approx: Option<f64>,
pub format: Option<String>,
pub format_id: Option<String>,
pub format_note: Option<String>,
Expand Down Expand Up @@ -209,7 +212,10 @@ pub struct SingleVideo {
pub extractor: Option<String>,
pub extractor_key: Option<String>,
pub filesize: Option<i64>,
#[cfg(feature = "youtube-dl")]
pub filesize_approx: Option<String>,
#[cfg(feature = "yt-dlp")]
pub filesize_approx: Option<f64>,
pub format: Option<String>,
pub format_id: Option<String>,
pub format_note: Option<String>,
Expand Down Expand Up @@ -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,
}

0 comments on commit a76a03c

Please sign in to comment.