initial import

This commit is contained in:
Gilles Grandou 2015-10-07 11:11:02 +02:00
commit b078fbde7c
2 changed files with 48 additions and 0 deletions

README.txt Normal file
View File

@ -0,0 +1,20 @@
When attempting to add the Atom feeds for YouTube Channels, sometimes TT-RSS will be unable to find the feed.
I've been running into this issue since YouTube disabled v2 of their data API, and I decided to try my hand at writing a plugin to fix it.
The problem is that some channel pages don't seem to link to their Atom feeds, yet others do. I do not know what causes this.
The result of this problem is that some RSS feeds for YouTube channels can be added to TT-RSS simply by pasting the YouTube channel URL in the Add Subscription box, yet for other channels this will result in TT-RSS (correctly) stating there are no feeds on the page.
The plugin I ended up making is a bit of a hack: Whenever you try to subscribe to a URL like this:<channel id> (e.g. the plugin will translate this into a subscription for the Atom feed. YouTube uses these URLs when you click the channel name below a YouTube video.
It does not work for URLs like<nickname>.
Installation instructions
Extract the youtube_subscription directory from the ZIP-file into your plugins or plugins.local directory of your TT-RSS installation.
Then enable the youtube_subscription plugin in your TT-RSS settings.
Now subscribing to<channel id> URLs should correctly add the relevant Atom feed subscription.
Stijn Gijsen <>

init.php Normal file
View File

@ -0,0 +1,28 @@
class Youtube_Subscription extends Plugin {
private $host;
function about() {
return array(1.0,
"Allows subscribing to YouTube Channel Atom feeds via<channel ID> URLs",
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_SUBSCRIBE_FEED, $this);
function hook_subscribe_feed($contents, $url, $auth_login, $auth_pass) {
if (preg_match("/youtube\.com\/channel\/(UC.*)$/", $url, $matches) === 1) {
$channel_id = $matches[1];
$contents = "<html><head><link rel=\"alternate\" type=\"application/atom+xml\" href=\"$channel_id\" /></head><body></body></html>";
return $contents;
function api_version() {
return 2;