From 28d7042ef9a94c77a2de54902ecd46591940555e Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Wed, 3 Jun 2020 00:14:47 +0530 Subject: [PATCH] Reimplement streaming of playlists --- src/lib.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.nim b/src/lib.nim index 67095ac..4305b2c 100644 --- a/src/lib.nim +++ b/src/lib.nim @@ -52,6 +52,7 @@ proc presentVideoOptions*(searchResults: SearchResults) = styledEcho $index, ". ", styleBright, fgMagenta, title, "\n", resetStyle, fgCyan, url, "\n" func isPlaylist(url: string): bool = + # Identifies if video is part of a playlist # Only YouTube playlists are supported for now "www.youtube.com" in url and "&list=" in url @@ -62,7 +63,8 @@ func buildPlayerArgs(url: string, options: Table[string, bool], player: string): if options["fullScreen"]: args.add("--fullscreen") # Playlists are only supported for MPV player if isPlaylist(url) and player == "mpv": - args.add("--ytdl-raw-options=\"yes-playlist=\"") + let list_arg = url.split('&')[1] + args[0] = "https://www.youtube.com/playlist?" & list_arg return args proc play*(player: string, options: Table[string, bool], url: string, title: string = "") = -- 2.43.0