Skip to content

Commit

Permalink
Fix looking up YouTube @username URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Apr 2, 2023
1 parent d713c16 commit cf63c3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@
# https://www.youtube.com/watch?v=vVXbgbMp0oY&t=5s
elsif /youtube\.com\/.*[?&]list=(?<playlist_id>[^&#]+)/ =~ params[:q]
# https://www.youtube.com/playlist?list=PL0QrZvg7QIgpoLdNFnEePRrU-YJfr9Be7
elsif /youtube\.com\/@?(?<user>[^\/?#]+)/ =~ params[:q]
elsif /youtube\.com\/(?<user>[^\/?#]+)/ =~ params[:q]
# https://www.youtube.com/khanacademy
# https://www.youtube.com/@khanacademy
# https://www.youtube.com/@awscommunity
elsif /\b(?<channel_id>(?:UC[^\/?#]{22,}|S[^\/?#]{12,}))/ =~ params[:q]
# it's a channel id
else
Expand Down

0 comments on commit cf63c3a

Please sign in to comment.