pytube.exceptions.RegexMatchError: regex pattern ((?:v=|\/)([0-9A-Za-z_-]{11}).*) had zero matches

See original GitHub issue

import 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=1726sprint(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:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Apfelvatercommented, Aug 5, 2019

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.

1reaction
sdsouza33commented, Dec 16, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Receiving "pytube.exceptions.RegexMatchError: regex pattern ...
had zero matches ... except pytube.exceptions.RegexMatchError: print('The Regex pattern did not return any matches for the video: ...
Read more >
regex pattern ((?:v=|\/)([0-9A-Za-z_-]{11}).*) had zero matches
pytube.exceptions.RegexMatchError: regex pattern ((?:v=|\/)([0-9A-Za-z_-]{11}).*) had zero matches.
Read more >
How to use the pytube.exceptions.RegexMatchError function ...
regex = re.compile(pattern, flags) results = regex.search(string) if not results: raise RegexMatchError( 'regex pattern ({pattern}) had zero matches' ...
Read more >
get_throttling_function_name: could not find match for multiple
[A-Z]&&\(b=a\.get\("n"\)\)&&\(b=([^(]+)\(b\)',In this video, you will leran how to fix the error: pytube. exceptions. RegexMatchError : get_t.
Read more >
pytube.exceptions — pytube 12.1.2 documentation
[docs]class RegexMatchError(ExtractError): """Regex pattern did not return any matches.""" def __init__(self, caller: str, pattern: Union[str, Pattern]): ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found