ocdownloader
ocdownloader copied to clipboard
Fix Youtube playlist download with youtube-dl
Only the first video of a playlist is downloaded from a Youtube.
It's not a bug. There is no links to playlist. All links points to specific video in playlist. So I made it consciously.
After install last version of youtube-dl, links with playlists don't work properly. So this part of code have to be rewritten.
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.
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.
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 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.
Sorry, I misunderstood. Anyway, my point is a playlists must be ignored by default.
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...
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.
Need testers and some JS support.
@Loki3000 I will test it as soon as possible.
@e-alfred I'm curious! Did you have a chance to run some tests already? ;) SCNR!
Seriously, what's missing? I could maybe help ...
--yes-playlist add a youtube-dl config file -c maybe. exploring...