Skip to content

Commit

Permalink
Input: Allows yt-dlp usage as another youtube-dl fork (#90)
Browse files Browse the repository at this point in the history
Signed-off-by: Miezhiko <[email protected]>
  • Loading branch information
Miezhiko authored Oct 10, 2021
1 parent e25cc14 commit 6fcb196
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ tokio-02-marker = []

# Behaviour altering features.
youtube-dlc = []
yt-dlp = []
builtin-queue = []

# Used for docgen/testing/benchmarking.
Expand Down
2 changes: 2 additions & 0 deletions src/input/ytdl_src.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use tracing::trace;

const YOUTUBE_DL_COMMAND: &str = if cfg!(feature = "youtube-dlc") {
"youtube-dlc"
} else if cfg!(feature = "yt-dlp") {
"yt-dlp"
} else {
"youtube-dl"
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
//! [`ConnectionInfo`]: struct@ConnectionInfo
//! [lavalink]: https://github.com/freyacodes/Lavalink
#[cfg(all(feature = "youtube-dlc", feature = "yt-dlp"))]
compile_error!("feature \"youtube-dlc\" and feature \"yt-dlp\" cannot be enabled at the same time");

mod config;
pub mod constants;
#[cfg(feature = "driver-core")]
Expand Down

0 comments on commit 6fcb196

Please sign in to comment.