Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

youtube-dl, how do I resume a download after error?

I am using youtube-dl to download videos from Lynda (I have an account).

After about the 40th video in a list I received this error:

ERROR: Unable to download JSON metadata: HTTP Error 403: Forbidden

Is there a way to 'restart' the downloads so I don't have to start from the first file again? Say just tell it to start from file 41 or something?

This is the command I used to download:

./youtube-dl --cookies cookies.txt --username <myusername> --password <mypassword> --sleep-interval 200 -o "%(autonumber)s - %(title)s.%(ext)s” http://www.lynda.com/C-tutorials/C-Essential-Training/188207-2.html 
like image 394
pelagos Avatar asked Mar 14 '16 08:03

pelagos


People also ask

How do I re download a failed YouTube video?

Make sure your YouTube Premium membership has not expired. Paid memberships and scroll down to Manage. If you recently lost access to YouTube Premium and re-subscribed, it will take a few hours for saved videos to show once you've re-subscribed. and select Retry download.

Can Youtube-DL download part of a video?

How do I download part of a YouTube video DL? Use youtube-dl –youtube-skip-dash-manifest -g "URL" to get the video and audio streams. You'll need to use the -ss option for each stream. I also recommend doing it about 30 seconds earlier and then using another -ss 30 to avoid losing any key frames.


1 Answers

It's good to use a combination of -ciw when downloading playlists.

-i, --ignore-errors    Continue on download errors, for example to skip                        unavailable videos in a playlist -w, --no-overwrites    Do not overwrite files -c, --continue         Force resume of partially downloaded files.                        By default, youtube-dl will resume downloads if possible. 

The following example downloads top 100 songs on YouTube Music

youtube-dl -ciw --playlist-items 1-100 --extract-audio --audio-format mp3 --restrict-filenames https://www.youtube.com/playlist?list=PLDcnymzs18LWrKzHmzrGH1JzLBqrHi3xQ 

The actual link to Youtube Music playlist varies with time, I guess. You can go the the playlist and copy. One way to check whether a link refers to a playlist or a single video, is that the playlist link has "playlist" keyword in it.

like image 161
srinivasu u Avatar answered Oct 08 '22 11:10

srinivasu u