lib/onebox/engine/youtube_onebox.rb in onebox-1.3.7 vs lib/onebox/engine/youtube_onebox.rb in onebox-1.3.8
- old
+ new
@@ -9,10 +9,10 @@
# Try to get the video ID. Works for URLs of the form:
# * https://www.youtube.com/watch?v=Z0UISCEe52Y
# * http://youtu.be/afyK1HSFfgw
# * https://www.youtube.com/embed/vsF0K3Ou1v0
def video_id
- match = @url.match(/^https?:\/\/(?:www\.)?(?:m\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_\-]{11})$/)
+ match = @url.match(/^https?:\/\/(?:www\.)?(?:m\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_\-]{11})(?:\?.*)?$/)
match && match[1]
end
def placeholder_html
if video_id