Skip to content

Commit

Permalink
Support YouTube TV URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Jan 12, 2021
1 parent 219cbfe commit a978117
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@
# there is no way to resolve these accurately through the API, the best way is to look for the channelId meta tag in the website HTML
# note that slug != username, e.g. https://www.youtube.com/c/kawaiiguy and https://www.youtube.com/user/kawaiiguy are two different channels
user = "#{type}/#{slug}"
elsif /youtube\.com\/tv#\/watch\/video\/.*[?&]v=(?<video_id>[^&]+)/ =~ params[:q]
# https://www.youtube.com/tv#/zylon-detail-surface?c=UCK5eBtuoj_HkdXKHNmBLAXg&resume
# https://www.youtube.com/tv#/watch/video/idle?v=uYMD4elmVIE&resume
# https://www.youtube.com/tv#/watch/video/control?v=uYMD4elmVIE&resume
# https://www.youtube.com/tv#/watch/video/control?v=u6gsOQ8HZAU&list=PLTU3Sf6dSBnDnhfG6iCy41Pk6de7OHRZh&resume
elsif /youtube\.com\/.*[?&]v=(?<video_id>[^&#]+)/ =~ params[:q]
# https://www.youtube.com/watch?v=vVXbgbMp0oY&t=5s
elsif /youtube\.com\/.*[?&]list=(?<playlist_id>[^&#]+)/ =~ params[:q]
Expand Down

0 comments on commit a978117

Please sign in to comment.