Skip to content

Commit

Permalink
A crack at fixing youtu.be urls with time markers
Browse files Browse the repository at this point in the history
  • Loading branch information
lepinkainen committed Apr 19, 2015
1 parent 6e71193 commit 6944c36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyfibot/modules/module_urltitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ def _handle_youtube_gdata(url):

api_url = 'https://www.googleapis.com/youtube/v3/videos'

match = re.match("https?://youtu.be/(.*)", url)
# match both plain and direct time url
match = re.match("https?://youtu.be/([^\?]+)(\?t=.*)?", url)
if not match:
match = re.match("https?://.*?youtube.com/watch\?.*?v=([^&]+)", url)
if match:
Expand Down

0 comments on commit 6944c36

Please sign in to comment.