-
Notifications
You must be signed in to change notification settings - Fork 12
/
README
43 lines (31 loc) · 1.83 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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/