fix: handle SoundCloud URLs with query parameters

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-09-11 11:00:52 +01:00
parent 7eaff29e6d
commit b7392fc7b4

View file

@ -86,10 +86,11 @@ fn download_media(video_url: &str, download_path: &Path, settings: &Settings) ->
} }
} else if video_url.contains("soundcloud.com") { } else if video_url.contains("soundcloud.com") {
println!("[INFO] Soundcloud link detected. Using scdl..."); println!("[INFO] Soundcloud link detected. Using scdl...");
let clean_url = video_url.split('?').next().unwrap();
cmd = Command::new("scdl"); cmd = Command::new("scdl");
cmd.args([ cmd.args([
"-l", "-l",
video_url, clean_url,
"-c", "-c",
"--onlymp3", "--onlymp3",
"--yt-dlp-args", "--yt-dlp-args",