Download videos from a given channel URL on a certain day

Is there a way within yt-dl to download every video (or at least extract the URL of every video) on a Youtube channel for a given day (or datetime range)?

Example:

Channel A has 4 videos total, 2 are uploaded since midnight yesterday. I want to download both of those videos, but not the other 2 older videos (there are plenty of options for downloading an entire channel's archive, that is not what I am trying to do).

Posted Sep 8, 2020, 1:43 AM UTC

17
kyjb70•

Not with YT-Dl. Set up a cronjob.

2
TheOnlyQueueOP•

Sorry, I should have specified. I am already running a cronjob at midnight for my downloader script, I was wondering specifically how I download the videos within a channel for that given day.

1
werid💡 Erudite Mod•

are you asking because you've previously downloaded the files before that given day? or because you want to limit youtube-dl from going through entire list of videos?

there are several ways to do that if so.

i use the combination of the download archive, which makes youtube-dl automatically skip videos previously downloaded, and i use the playlist limit (--playlist-end 50) which stops it from having to download all the pages of videos before it starts downloading, especially useful on big channels.

if you only use the date options, youtube-dl will still have to download the entire channel list of videos because it does not know what order the videos are in.

1
nanowire•

There seems to be three options for specific date downloads in the documentation...

 --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)

Now I haven't used this feature myself, but this askubuntu forum post breaks down how exactly you need to reference the date with these options... (copied for reference)...

Not stated there, but only hidden in the code, is that DATE is in the format YYYYMMDD or (now|today)[+-]0-9(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

will download all videos from a channel uploaded between and including August 8th and August 10th 2016, and:

youtube-dl -i --dateafter now-1week

will download all videos from a playlist uploaded in the past week.

2
TheOnlyQueueOP•

Thank you, I was really confused at how the docs showed how to download videos in a given date range from a playlist but not how to download from a given channel in that date range. I'll check out that post and try it now.

1
werid💡 Erudite Mod•

ah, youtube-dl treats channels as playlists internally, so anything that works on a playlist works on a channel

1
TheOnlyQueueOP•

That makes so much more sense

1