Yes. From the youtube-dl man page:
--date DATE
Download only videos uploaded in this date
--datebefore DATE
Download only videos uploaded on or before this date (i.e. inclusive)
--dateafter DATE
Download only videos uploaded on or after this date (i.e. inclusive)
Not stated there, but only hidden in the code, is that DATE
is in the format YYYYMMDD
or
(now|today)[+-][0-9](day|week|month|year)(s)?
, so for example the 17th August 2016 would be 20160817
, and seven days ago would be now-7days
or now-1week
.
You can specify a range by using --datebefore
and --dateafter
together, so:
youtube-dl -i --dateafter 20160808 --datebefore 20160810 https://www.youtube.com/channel/CHANNEL
will download all videos from a channel uploaded between and including August 8th and August 10th 2016, and:
youtube-dl -i --dateafter now-1week https://www.youtube.com/playlist?list=PLAYLIST
will download all videos from a playlist uploaded in the past week.
The -i
option prevents youtube-dl
from exiting prematurely if some videos are unavailable.
Note youtube-dl
will still say it is downloading each video even when it doesn't. For example:
[download] Downloading video 1 of 123
[youtube] xxxxxxxxxxx: Downloading webpage
[youtube] xxxxxxxxxxx: Downloading video info webpage
[youtube] xxxxxxxxxxx: Extracting video information
[youtube] xxxxxxxxxxx: Downloading MPD manifest
[download] 2016-08-07 upload date is not in range 2016-08-08 - 2016-08-10
[download] Downloading video 2 of 123
...
Playlist
youtube-dl -f FORMAT -ciw --output '%(title)s.%(ext)s' --playlist-start NUMBER-START --playlist-end NUMBER-END <url-of-playlist>
...where <url-of-playlist>
is replaced by the URL of the playlist, replace FORMAT
with any available video format, for example 18
, NUMBER-START
is the number of the video in the playlist to start downloading first, and NUMBER-END
is the number of the video in the playlist to download last.
Channel
If a channel has more than one playlist, click on the first playlist and download all the videos in the selected playlist using the above command. Then repeat for each playlist in the channel.
Explanation
-f, --format FORMAT
video format code. The -F option (capital F) displays all available video
formats for a video link. Example: youtube-dl -F <url-of-video>
-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
Convert all the video titles to lowercase
youtube-dl -f FORMAT -ciw --output '%(title)s.%(ext)s' --playlist-start NUMBER-START --playlist-end NUMBER-END <url-of-playlist>
find -type f -exec rename 'y/A-Z/a-z/' {} +
Explanation
--output '%(title)s.%(ext)s'
output file name(s) as the name of the video, followed by a dot character and the video's extension
find -type f
Find all files.
y/source/destination/
Transliterate the characters in the pattern space which appear in source
to the corresponding character in destination.
Best Answer
There is indeed a plethora of techniques available online to accomplish this. One fairly basic technique is the following one liner which works well enough on my system with a YouTube clip:
The 2 sections which govern the clip start and end in this example are:
I have tested this extensively with YouTube and all works well on my own system...
References: