There is a built-in search option for youtube-dl. Old way:
youtube-dl "gvsearch1:how to create android app in app studio"
The argument is: gvsearchX
, where gvsearch
means use google and X
is the number of results you want to download. So the above will search for "how to create android app in app studio" and download the first result.
(Update!) Seems like ytsearch (youtube search) is the better approach now:
youtube-dl "ytsearch1:how to create android app in app studio"
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
...
Best Answer
You can use:
--playlist-start
,--playlist-end
,--playlist-reverse
or--playlist-items
to achieve this goal.For example to download 2 through 8:
To download first 5:
From 7 onward:
Or to download 2,4,6:
Or even specify a range of videos:
To get the last ones you should use
--playlist-reverse
, for example for last 6: