2

Can I do a date-wise download of youtube videos of particular user or playlist using youtube-dl ?

For example - download all videos uploaded by User X in this week.

Looking for provision of downloading youtube videos from a channel/user/playlist with start-date and end-date.

4
  • No its not. Do not miss the "date-wise" part.
    – Jaydev
    Aug 12, 2016 at 5:39
  • Downloading a date range with youtube-dl is a little bit more complicated, but there is an answer about that too in a different question: askubuntu.com/questions/334081/… This answer is actually the way I usually do it myself, because I usually don't want to download some of the videos in a playlist, so I have to make a list of all the downloadable video links and then delete the links that I don't want.
    – karel
    Aug 12, 2016 at 5:42
  • This isn't a duplicate, how do I remove that ? Can I get the video info like date of upload before triggering download?
    – Jaydev
    Aug 12, 2016 at 5:52
  • Alright, I get it that you want to scrape the videos' date data from the YouTube website automatically, so I retracted my "possible duplicate of...". There is a package for scraping website data in the default Ubuntu repositories, so it should be possible to do it automatically.
    – karel
    Aug 12, 2016 at 6:01

2 Answers 2

9

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
...
0
0

Maybe your looking for this solution to sync a playlist or channel.

youtube-dl -o "%(title)s.%(ext)s" -x --audio-format mp3 --audio-quality 0 --download-archive Filename.txt https://www.youtube.com/playlist?list=PLAYLIST

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .