Regex format fix

This commit is contained in:
Fabio Manganiello 2020-07-04 00:18:45 +02:00
parent 03dc524f80
commit 93ac6c8af9

View file

@ -483,15 +483,15 @@ class MediaPlugin(Plugin):
patterns = [ patterns = [
re.compile(pattern) re.compile(pattern)
for pattern in [ for pattern in [
'https?://www.youtube.com/watch?v=([^&#]+)' r'https?://www.youtube.com/watch?v=([^&#]+)'
'https?://youtube.com/watch?v=([^&#]+)' r'https?://youtube.com/watch?v=([^&#]+)'
'https?://youtu.be/([^&#/]+)' r'https?://youtu.be/([^&#/]+)'
'youtube:video:([^&#:])' r'youtube:video:([^&#:])'
] ]
] ]
for pattern in patterns: for pattern in patterns:
m = re.match(pattern, url) m = pattern.match(url)
if m: if m:
return m.group(1) return m.group(1)