forked from ali1234/ytsubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
39 lines (29 loc) · 1.74 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
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. You are allowed to use
50,000,000 units per day so you should not run into the limits
if you are only updating hourly, even if you have thousands of subs.
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