I'm downloading an entire YouTube channel consisting of about 10,000 videos. Sometimes the download stops due to errors like "content too short" or "connection interrupted". However, is there a way to automatically restart the download? There is probably a batch file you can make, but I don't know how to make one.

This is the command I use to download:

youtube-dl -f bestvideo+bestaudio ytuser:(Channel) -o "/Videos/lhs/[%(upload_date)s - %(id)s] %(title)s.%(ext)s" --ffmpeg-location %CD%\ffmpeg\bin

This answer won't work on older versions of youtube-dl. You need to update youtube-dl to the latest version. If you have Python installed on your system, you can install the latest version of youtube-dl locally inside a Python virtual environment, or you can download the latest version of youtube-dl and install it globally.

In Ubuntu 14.04 and later youtube-dl is also a snap package. To install it type:

sudo snap install youtube-dl # start with snap run youtube-dl 

Open the terminal and type:

youtube-dl -f best -ciw -o "%(title)s.%(ext)s" -v <url-of-channel>

...where <url-of-channel> is replaced by the URL of the channel.

Note: If you are downloading a lot of videos, you should change directories to the directory where you want to save the videos before you start downloading them.


-f, --format FORMAT
    video format code. The special name "best" will pick the best quality.

-c, --continue                   
    force resume of partially downloaded files

-i, --ignore-errors              
    continue on download errors, for example to skip unavailable videos in a channel 

-w, --no-overwrites
    do not overwrite files

-v, --verbose
    print various debugging information
  • 2
    Good one! +1 ;-) – Fabby Oct 20 '16 at 7:48
  • I'm not downloading a playlist, I'm downloading an ENTIRE YouTube channel consisting of about 10,000 videos. The -c or -i will not help in my problem. – INeedHelp101 Oct 20 '16 at 16:34
  • Forget the last sentence of my previous comment. I'm gonna try and see if it works with -c or -i. This is my command now – INeedHelp101 Oct 20 '16 at 16:36
  • >youtube-dl -f bestvideo+bestaudio ytuser:lylehsaxon -o "/Videos/lhs/[%(upload_date)s - %(id)s] %(title)s.%(ext)s" --ffmpeg-location %CD%\ffmpeg\bin -c -i – INeedHelp101 Oct 20 '16 at 16:37
  • Put the -c and the -i in the same place where I put it in the first command in my answer. – karel Oct 20 '16 at 17:07

If you look youtube-dl man page you will see option to resume partial downloads.

-c, --continue
           Resume partially downloaded files.

Man Page Link

  • Yes I saw that and that is not what I'm looking for. When hits the errors I mentioned above, it completely stops and I have to manually restart it. I'm looking for something that will automatically restart it. – INeedHelp101 Oct 20 '16 at 5:15
  • Ok I will write code hang on..I m in travel. In mean time study about bash if , pgrep and crontab. – rɑːdʒɑ Oct 20 '16 at 5:56
  • I forgot to mention. I'm on Windows 10, not Ubuntu. So a bat file will be needed I know a bit about scripts but not too much. – INeedHelp101 Oct 20 '16 at 7:32
  • 1
    @INeedHelp101: Windows is off-topic here, so no, you will not receive a BAT file, only shell scripts – Fabby Oct 20 '16 at 7:47

you should use the option "--download-archive". That will skip already downloaded videos from your playlist/channel.

  • 2
    Please be a little more specific with your detail, consider adding some reference and proof supporting what you state, and confirm this answer is not already answered in one of the existing answers on the post. – Drink Some Pimp Juice IT Sep 5 '17 at 1:56

A helpful script: youtube_channel_archiver

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy