From a6c32f4f32266bfabf16502c1bfc7149f0c44b76 Mon Sep 17 00:00:00 2001 From: depsterr Date: Fri, 9 Jul 2021 19:11:46 +0200 Subject: [PATCH] prevent issues when downloading playlists --- src/YTDL.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/YTDL.hs b/src/YTDL.hs index 94b95b9..70573e7 100644 --- a/src/YTDL.hs +++ b/src/YTDL.hs @@ -35,6 +35,9 @@ resToArgs (P1080) = wrapResString "1080" resToArgs (PMAX) = ["-f", "bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4", "--merge-output-format", "mp4"] resToArgs (Audio) = ["-x", "--audio-format", "mp3"] +extraYtdlArgs :: [String] +extraYtdlArgs = ["--no-playlist"] + ytdl :: String -> Resolution -> ReaderT ViddlConfig IO (Either String FilePath) ytdl url res = ReaderT $ \cfg -> do @@ -57,7 +60,7 @@ ytdl url res = ReaderT $ \cfg -> do print (resToArgs res <> ["-o", fileName, url]) - ytdlProc <- createProcess (proc "youtube-dl" (resToArgs res <> ["-o", fileName, url])) + ytdlProc <- createProcess (proc "youtube-dl" (resToArgs res <> ["-o", fileName, url] <> extraYtdlArgs)) case ytdlProc of (_, _, _, ph) -> do