ocdownloader icon indicating copy to clipboard operation
ocdownloader copied to clipboard

Fix Youtube playlist download with youtube-dl

Open e-alfred opened this issue 7 years ago • 13 comments

Only the first video of a playlist is downloaded from a Youtube.

e-alfred avatar Aug 28 '17 16:08 e-alfred

It's not a bug. There is no links to playlist. All links points to specific video in playlist. So I made it consciously.

Loki3000 avatar Sep 04 '17 20:09 Loki3000

After install last version of youtube-dl, links with playlists don't work properly. So this part of code have to be rewritten.

Loki3000 avatar Sep 05 '17 19:09 Loki3000

well... a playlist only has an addition like &list=0123456789ABCDEFGH to the currently played video-link, which makes sense when you think about it because the same video can appear in different lists.

the question (i can't answer because i hardly use youtube or youtube-dl) is, can all video-urls be somehow gathered via the &list=0123456789ABCDEFGH? update: obviously yes, see https://github.com/e-alfred/ocdownloader/issues/18#issuecomment-327285760.

  • if yes, all videos should be downloaded when a playlist-url is entered... (or the user may be asked somehow.)
  • if not, as a fallback not the first video should be downloaded, rather the currently played video should be downloaded. so when i enter https://www.youtube.com/watch?v=b8OELzmpgZo&list=PL7F37BB1A67E0238D for sure the first video is downloaded but when in enter https://www.youtube.com/watch?v=j1eI-7XWjho&list=PL7F37BB1A67E0238D the playlist should be ignored and the currently played one should be downloaded.

DJCrashdummy avatar Sep 05 '17 19:09 DJCrashdummy

interesting... after a quick look at the youtube-dl man-page i saw the following options:

   --flat-playlist
          Do not extract the videos of a playlist, only list them.

   --no-playlist
          Download  only  the  video,  if  the URL refers to a video and a
          playlist.

   --yes-playlist
          Download the playlist, if the  URL  refers  to  a  video  and  a
          playlist.

so a complete playlist-download may be possible.

DJCrashdummy avatar Sep 05 '17 19:09 DJCrashdummy

if not, not the first video should be downloaded

Why first? Link points to specific video which could be in any position in playlist. The expected behavior is to download video that opens by provided link. Average user don't know consists link playlist or not. He just want to download target video.

Loki3000 avatar Sep 05 '17 20:09 Loki3000

@Loki3000 please read what i wrote:

if not, NOT the first video should be downloaded, rather the currently played video should be downloaded.

i also added an example to explain it further... so we are talking about pretty the same.

DJCrashdummy avatar Sep 05 '17 20:09 DJCrashdummy

Sorry, I misunderstood. Anyway, my point is a playlists must be ignored by default.

Loki3000 avatar Sep 05 '17 20:09 Loki3000

for me this would be a similar setting like "only extract audio?"... so may i suggest a setting at the same place for "downloading complete playlist, if available?" from my point of view this would be the best solution, to have both possibilities available. and then the default setting isn't such a big thing and can still be discussed...

DJCrashdummy avatar Sep 05 '17 21:09 DJCrashdummy

By default only downloading the current video would be okay. Althought an option to download the whole playlist like mentioned by @DJCrashdummy would be a good approach to take.

Additionally, there are more video links possible like for example https://www.youtube.com/playlist?list=5467546456457846 . These should be treated like playlists and downloaded as a whoie accordingly.

e-alfred avatar Sep 05 '17 23:09 e-alfred

Need testers and some JS support.

Loki3000 avatar Sep 19 '17 12:09 Loki3000

@Loki3000 I will test it as soon as possible.

e-alfred avatar Sep 20 '17 18:09 e-alfred

@e-alfred I'm curious! Did you have a chance to run some tests already? ;) SCNR!

Seriously, what's missing? I could maybe help ...

diresi avatar Nov 06 '21 00:11 diresi

--yes-playlist add a youtube-dl config file -c maybe. exploring...

63949 avatar Aug 20 '22 07:08 63949