Skip to content

Commit

Permalink
Redirect /c/ youtube urls to their feed api endpoint (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
onli committed Nov 13, 2020
1 parent 289a9e7 commit df397f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blocks/feedblock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def detectHiddenFeeds(url)
feedid = url.scan(/channel\/[^\/]+/).first.gsub('channel/', '')
url = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + feedid
end
if (url.include?('www.youtube.com/c/'))
feedid = url.scan(/c\/[^\/]+/).first.gsub('c/', '')
url = 'https://www.youtube.com/feeds/videos.xml?user=' + feedid
end
if (url.include?('www.youtube.com/user'))
feedid = url.scan(/user\/[^\/]+/).first.gsub('user/', '')
url = 'https://www.youtube.com/feeds/videos.xml?user=' + feedid
Expand Down

0 comments on commit df397f7

Please sign in to comment.