Better parsing of twitch urls, strip query

This commit is contained in:
Ivan Habunek 2019-02-20 16:04:23 +01:00
parent 5b1b1ba4ff
commit 2a382087dd
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -163,7 +163,7 @@ def parse_video_id(video_id):
if re.search(r"^\d+$", video_id):
return int(video_id)
match = re.search(r"^https://www.twitch.tv/videos/(\d+)$", video_id)
match = re.search(r"^https://www.twitch.tv/videos/(\d+)(\?.+)?$", video_id)
if match:
return int(match.group(1))