Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Retrieve N most recent from playlist #25048
Comments
|
Technically impossible. Youtube does not provide ability to enumerate playlists from the end. |
Checklist
Description
Need the ability to retrieve the n most-recently uploaded videos from a playlist of a variable length.
I use youtube-dl to keep on top of all my favorite youtube vlogs via crontab, for consumption in my own media streamer, hosted on my LAN. Some vloggers sort their playlist with the oldest video first, so my normal method of using a script to set --playlist-end to a fixed number results in the first N videos from the list being downloaded each day, instead of the last. Therefore none of the new content ever downloads.
I have tried to use the --dateafter filter to prevent downloading titles more recent than an aribtrary cutoff (relative date), but this simply prevents the old videos from downloading -- it still never validates any newer items from the playlist. I do not wish to download the entire playlist every time my cron job runs, obviously - I already have that content cached.
I have also tried using the --playlist-reverse switch, but that merely controls the download order, not the order in which the list is evaluated.
Ideally an option that handles this for me (eg: --n-recent ) would be created that would pull all titles and upload dates from the playlist, sort them and then return the n most recent in order of recency.
Alternatively, provide an option to control how the list is sorted before the playlist-end flag takes effect so that I can --playlist-reverse and --playlist-end 3 to get the 3 newest titles (not the first three titles downloaded in reverse order.)