Skip to content

Commit

Permalink
Do not try to embed some Twitch pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Oct 26, 2018
1 parent b048466 commit efd6468
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/05-string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def embed_html(request=nil)
"<iframe width='853' height='480' src='https://player.vimeo.com/video/#{id}' frameborder='0' scrolling='no' allowfullscreen referrerpolicy='no-referrer'></iframe>"
elsif %r{^https?://(?:www\.)?instagram\.com/p/(?<id>[^/?#]+)} =~ self
"<iframe width='612' height='710' src='https://www.instagram.com/p/#{id}/embed/' frameborder='0' scrolling='no' allowfullscreen referrerpolicy='no-referrer'></iframe>"
elsif %r{^https?://(?:www\.)?twitch\.tv/(?:videos/(?<vod_id>\d+)|(?<channel_name>[^/]+)(?:/(?:v|video)/(?<vod_id>\d+))?).*?(?:[?&#](?:t|time)=(?<t>[^&#]+))?} =~ self
elsif %r{^https?://(?:www\.)?twitch\.tv/(?:videos/(?<vod_id>\d+)|(?<channel_name>[^/]+)(?:/(?:v|video)/(?<vod_id>\d+))?).*?(?:[?&#](?:t|time)=(?<t>[^&#]+))?} =~ self && !%w[directory broadcast].include?(channel_name)
# https://www.twitch.tv/videos/76877760?t=20h38m50s
# https://www.twitch.tv/gamesdonequick
# https://www.twitch.tv/gamesdonequick/video/76877760 (legacy url)
Expand Down

0 comments on commit efd6468

Please sign in to comment.