Absolutly disgusting script to create a single RSS feed with the last 50 videos from your YouTube subscriptions.
But at least it's in chronological order and without some sort of filtering.
It works on my machine, might not in yours.
If you don't know how to make this run by reading this document or how to use the command line, I'm not going to explain it to you in issues or in private (except if you're a friend).
But if my instructions below could be improved, please make a merge request.
- Have a webserver with PHP 7 (fpm and cli), the PHP-XML extension and composer installed.
- Point your webserver to the
public/folder. (Don't expose the entire project directory!)
- Create an app in the Google dev console
- In the side menu, go to "Libraries", search for "YouTube Data API" and enable it.
- Then create an Oauth Client for a web application with the correct redirect url pointing to where you serve the
- Once it's done, download the keys from the credentials list, you should get a
client_secret[...].jsonfile. Rename it to
client_secret.jsonand put it next to
php fetch.php and follow the instructions to login.
Script will then run normally.
Create a cron running every 3 hours (or each hour if you don't have an insane amount of subs; you might have to
cd to the directory).
0 */3 * * * cd /var/www/yt2rss && php fetch.php > cron.log 2>&1
Add the feed to your RSS client using the path to the folder, if you want the
feed url to point correctly to your current host.
https://mydomain.com/youtuberss/ (instead of
Let's imagine I have 980 subs. On a run, the script could use
5944 units (estimation was
5980) of the
1 000 000 you're given per day. So I could run this (hourly) ~168 times in 24 hours.