pytube.exceptions.RegexMatchError: regex pattern ((?:v=|\/)([0-9A-Za-z_-]{11}).*) had zero matches
See original GitHub issueimport sys from pytube import YouTube
def youtube_video(vid): yt = YouTube(vid) print(yt.title)
video = ‘https://www.youtube.com/watch?v=aKOshK_HGSw&t=1726s’
print(youtube_video(video))
Traceback (most recent call last): File “youtube_mp3.py”, line 10, in <module> print(youtube_video(video)) File “youtube_mp3.py”, line 5, in youtube_video yt = YouTube(vid) File “/home/shiquann/.local/lib/python2.7/site-packages/pytube/main.py”, line 69, in init self.video_id = extract.video_id(url) File “/home/shiquann/.local/lib/python2.7/site-packages/pytube/extract.py”, line 43, in video_id return regex_search(r’(?:v=|/)([0-9A-Za-z_-]{11}).', url, group=1) File “/home/shiquann/.local/lib/python2.7/site-packages/pytube/helpers.py”, line 39, in regex_search .format(pattern=pattern), pytube.exceptions.RegexMatchError: regex pattern ((?:v=|/)([0-9A-Za-z_-]{11}).) had zero matches
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:14 (1 by maintainers)
Top GitHub Comments
tried it with https://www.youtube.com/watch?v=-sUXMzkh-jI today. doesnt work. EDIT: i was just to dumb to update pytube via pip. uninstall and installed pytube. works fine.
To solve the issue , here is a FIX - r’\bc\s*&&\sd.set([^,]+,.?((?P<sig>[a-zA-Z0-9$]+)((0\s*,\s*window.decodeURIComponent’
copy this pattern in get_initial_function_name of pytube/cipher.py
reference from #313