Re:Show HN: Tube – Minimalist YouTube
by enz on Saturday April 14, 2018 @08:16AM
(#16837007)
You don't need to scrap the page, YouTube provides the RSS stream for each channel: `https://www.youtube.com/feeds/videos.xml?channel_id=[ID]`. The RSS contains the "normal" link of each video, so you can invoke youtube-dl or mpv on it.
[ Parent
| on HN ]
> You don't need to scrap the page
They do if they are scraping playlists.
Youtube assumes that when creators make a playlist, they’ll add videos to the top. As such, the RSS for a playlist[1] always returns just the top 15 results. But a lot of creators — typically the ones that take greater care into organising their playlists, such as Crash Course[2] — add videos to the bottom of their playlists. Those RSS feeds will be stuck at the same 15 items forever, and your only option is to scrape the page.
[1]: https://www.youtube.com/feeds/videos.xml?playlist_id={playli...
You can use youtube-dl's archiving feature for that.
I use it regularly on my fairly large music playlist and it goes through all 20 pages just fine despite adding stuff on the bottom occasionally (I sorted it by creation date)