Tweak regexes

Allows support for mobile web urls
video_id regex pattern simplified
This commit is contained in:
Twilight0 2019-08-22 12:46:09 +03:00
parent f9478233b0
commit 8967f4f3d3
2 changed files with 3 additions and 3 deletions

View file

@ -414,7 +414,7 @@ def get_live(channel_id=None, user=None, url=None, addon_id=None):
matched_type = 'user'
elif url:
patterns = [r'^(?:http)*s*:*[/]{0,2}(?:www\.)*youtu(?:\.be|be\.com)/'
patterns = [r'^(?:http)*s*:*[/]{0,2}(?:w{3}\.|m\.)*youtu(?:\.be|be\.com)/'
r'(?P<type>channel|user)/(?P<channel_id>[^/]+)(?:/live)*$']
for pattern in patterns:

View file

@ -111,8 +111,8 @@ def resolve(video_id, sort=True, addon_id=None):
matched_id = None
streams = None
patterns = [r'(?P<video_id>[a-zA-Z0-9_\-]{11})',
r'(?:http)*s*:*[/]{0,2}(?:www\.)*youtu(?:\.be/|be\.com/'
patterns = [r'(?P<video_id>[\w-]{11})',
r'(?:http)*s*:*[/]{0,2}(?:w{3}\.|m\.)*youtu(?:\.be/|be\.com/'
r'(?:embed/|watch/|v/|.*?[?&/]v=))(?P<video_id>[a-zA-Z0-9_\-]{11}).*']
for pattern in patterns: