Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions youtui/src/youtube_downloader/yt_dlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ impl YoutubeMusicDownloader for YtDlpDownloader {
let command = self.yt_dlp_command.clone();
async move {
let args = vec![
// Force yt-dlp to stick to youtube downloading - sometimes its inferred if the ID
// doesn't start with a number but this is safer.
"--default-search",
"ytsearch",
// First, print filesize in bytes to stderr
"--print",
"filesize",
Expand All @@ -88,6 +92,9 @@ impl YoutubeMusicDownloader for YtDlpDownloader {
// Output song bytes to stdout
"-o",
"-",
// If the id starts with a hyphen yt-dlp will think that this its a command line
// argument instead of an ID; "--" escapes it.
"--",
song_video_id.as_ref(),
];
let proc = tokio::process::Command::new(command.deref())
Expand Down
Loading