Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

youtube-dl: How to skip videos with unavailable fragments in playlist, but not to abort playlist downloading?

I want to download a playlist of videos from youtube using youtube-dl for further offline viewing. Some videos have unavailable fragments (but for some reason there is no problem when viewing through browser). I want to download the playlist, but skip the videos with missing fragments.

My original run was:

youtube-dl -if bestvideo+bestaudio PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW

But it "freezes" at videos with missed fragments.

Later, in documentation I found this option option --abort-on-unavailable-fragment

But following command just aborts, when it takes 10 retries for attempt to download fragment.

youtube-dl --abort-on-unavailable-fragment -if bestvideo+bestaudio PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW

I also found parameter --skip-unavailable-fragments, but it just skips fragments, which are unavailable and continue to download next fragment. It results in glitches in video after merging.

youtube-dl --skip-unavailable-fragments -if bestvideo+bestaudio PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW

Are there any options / parameters to download the whole playlist, but as soon as there is video with missed fragment: skip that video and switch to the next video in playlist?

like image 774
Araneus0390 Avatar asked Jul 18 '19 17:07

Araneus0390


3 Answers

-i, --ignore-errors

This one works fine for me.

like image 66
harveyhans Avatar answered Oct 19 '22 03:10

harveyhans


--abort-on-unavailable-fragment  Abort downloading when some fragment is not
                                 available

This will skip the video if it has unavailable fragments, taken from the readme: https://github.com/ytdl-org/youtube-dl#download-options tested on the same issue.

like image 37
stackbox Avatar answered Oct 19 '22 05:10

stackbox


I tried the above mentioned answer but it aborts the whole playlist. I tried using -i which ignores all the errors and skips if the video is unavailable in your country. And this method works without any problems.

youtube-dl -i -o "%(title)s.%(ext)s" 'https://www.youtube.com/playlist?list=PLx65qkgCWNJIs3FPaj8JZhduXSpQ_ZfvL'
  1. use --extract-audio if you want only audio
  2. use --audio-format mp3 if you want to specify the audio format
like image 27
Mohanvenkat Avatar answered Oct 19 '22 03:10

Mohanvenkat