Skip to content

Commit a0cef08

Browse files
committed
fixed internal youtube dl comment to yt-dlp
1 parent a04694a commit a0cef08

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ features = ["client", "voice", "rustls_backend"]
3030

3131
[dependencies.songbird]
3232
version = "0.3"
33-
# features = ["yt-dlp"]
33+
features = ["yt-dlp"]
3434

3535
[dependencies.poise]
3636
version = "0.4.1"

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ ENV DEBCONF_NONINTERACTIVE_SEEN true
55

66
RUN apt update
77
RUN apt install -y ffmpeg cmake python3-pip
8-
RUN pip install youtube-dl
8+
RUN pip install yt-dlp
99

1010
COPY . /app
1111
WORKDIR /app/
12-
ENV PATH="/app/yt-dlp-linux/:$PATH"
1312

1413
RUN cargo build --release
1514

src/media/metadata.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use tracing::error;
44

55
use super::media_info::{MediaInfo, PlaylistInfo};
66

7+
const YOUTUBE_DL_COMMAND: &str = "yt-dlp";
8+
79
#[derive(Serialize, Deserialize)]
810
struct YoutubeDLJson {
911
id: Option<String>,
@@ -74,7 +76,7 @@ impl From<YoutubeDLFlatJson> for MediaInfo {
7476
}
7577

7678
pub fn get_info(url: &String) -> Result<MediaInfo, String> {
77-
match process::Command::new("youtube-dl")
79+
match process::Command::new(YOUTUBE_DL_COMMAND)
7880
.arg("-j")
7981
.arg("--no-playlist")
8082
.arg(url)
@@ -115,7 +117,7 @@ pub fn get_search(query: &String) -> Result<MediaInfo, String> {
115117
pub fn get_playlist(url: &String) -> Result<LinkedList<MediaInfo>, String> {
116118
let mut sources: LinkedList<MediaInfo> = LinkedList::new();
117119

118-
match process::Command::new("youtube-dl")
120+
match process::Command::new(YOUTUBE_DL_COMMAND)
119121
.arg("-j")
120122
.arg("--playlist-end=1")
121123
.arg(&url)
@@ -143,7 +145,7 @@ pub fn get_playlist(url: &String) -> Result<LinkedList<MediaInfo>, String> {
143145
}
144146
}
145147

146-
match process::Command::new("youtube-dl")
148+
match process::Command::new(YOUTUBE_DL_COMMAND)
147149
.arg("-j")
148150
.arg("--flat-playlist")
149151
.arg(&url)

yt-dlp-linux/youtube-dl

-26.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)