Improve Name regex to use 1 group, find first &

This commit is contained in:
danielcliu 2019-11-11 19:58:12 -08:00
parent d224b02a80
commit 54ef72fafd
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ class _TranscriptFetcher():
WATCH_URL = 'https://www.youtube.com/watch?v={video_id}' WATCH_URL = 'https://www.youtube.com/watch?v={video_id}'
API_BASE_URL = 'https://www.youtube.com/api/' API_BASE_URL = 'https://www.youtube.com/api/'
TIMEDTEXT_STRING = 'timedtext?v=' TIMEDTEXT_STRING = 'timedtext?v='
NAME_REGEX = re.compile(r'(&name=.*&)|(&name=.*)') NAME_REGEX = re.compile(r'&name=.*?(&)|&name=.*')
def __init__(self, video_id, languages, proxies): def __init__(self, video_id, languages, proxies):
self.video_id = video_id self.video_id = video_id