Skip to content

ali1234/ytsubs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

This python script will fetch the latest subscription videos for a 
named Youtube user. Usage:

    YOUTUBE_SERVER_API_KEY="<your_secret_key>" ./ytsubs.py <username> <output RSS file>

I recommend to put this into a cronjob so that it will only update
hourly due to the extreme inefficiency of the V3 API (see below).

The script uses the Youtube V3 API which requires you to create an 
application on the Google developer console before you can make 
requests. After you make the application you must enable
'YouTube Data API v3' access and create a server API key.

This is all explained here:

https://developers.google.com/youtube/registering_an_application

After you get your API key, add it to the command above. Note that
the API key owner does not need to be the same user you want to get
subscription videos for. The API allows you to read subscriptions
of any user who hasn't set their account to private.

The V3 API is incredibly inefficient at getting this information.
The script will make 2 API calls for every 50 subscriptions you have
and then it will make another API call for each subscription to get
the actual videos - THEN it makes another API call for each 50 videos
to get the real publication time.

If you have 100 subscriptions this script will use
around 500 API "units" each time you call it. Youtube has massively
restricted the free quota, but it should still be plenty.

Note that due to a bug in Firefox, you can't directly open the output
file with a file:// URL and create a live bookmark. You have to serve
it on http:// or you won't get this option. You can of course run a
tiny local webserver for this purpose.

See: https://bugzilla.mozilla.org/show_bug.cgi?id=1008788

Now that live bookmarks are being removed from Firefox core, I
recommend this add-on to replace them:

https://addons.mozilla.org/en-GB/firefox/addon/livemarks/

About

Python script to generate subscription video RSS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages