question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Downloading a video throws 'regex pattern ("signature",\s?([a-zA-Z0-9$]+)\() had zero matches'

See original GitHub issue

Stack trace:

  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\__main__.py", line 87, in __init__
    self.prefetch_init()
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\__main__.py", line 96, in prefetch_init
    self.init()
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\__main__.py", line 131, in init
    mixins.apply_signature(self.player_config_args, fmt, self.js)
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\mixins.py", line 41, in apply_signature
    signature = cipher.get_signature(js, stream['s'])
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\cipher.py", line 245, in get_signature
    tplan = get_transform_plan(js)
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\cipher.py", line 64, in get_transform_plan
    name = re.escape(get_initial_function_name(js))
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\cipher.py", line 40, in get_initial_function_name
    return regex_search(pattern, js, group=1)
  File "C:\Users\maxi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\helpers.py", line 39, in regex_search
    .format(pattern=pattern),
pytube.exceptions.RegexMatchError: regex pattern ("signature",\s?([a-zA-Z0-9$]+)\() had zero matches

I tried both on windows and ubuntu on different machines and this seems to be happening on most of the videos I try to download, e.g (https://www.youtube.com/watch?v=nFZP8zQ5kzk).

Any ideas what could be causing this?

EDIT: I just saw https://github.com/nficano/pytube/pull/313, which is already merged. Maybe youtube changed it’s signature again?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nficanocommented, Nov 12, 2018

let me take a look! thanks for reporting

0reactions
github-actions[bot]commented, Aug 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytube.exceptions.RegexMatchError: regex pattern ((?:v=|\/)([0 ...
regex pattern ("signature",\s?([a-zA-Z0-9$]+)\() had zero matches ... to get the title of the videos of a playlist without downloading them?
Read more >
Pytube is giving assorted regex errors - python - Stack Overflow
I reworked your code, which throws no errors on my system. ... Enter a YouTube URL or press D to download the video(s): ......
Read more >
Regular Expressions: Regexes in Python (Part 1)
In this tutorial, you'll explore regular expressions, also known as regexes, in Python. A regex is a special sequence of characters that defines...
Read more >
4. Pattern Matching with Regular Expressions - Java ... - O'Reilly
Regular expressions, or regexes for short, provide a concise and precise specification of patterns to be matched in text. As another example of...
Read more >
Regex.Match Method (System.Text.RegularExpressions)
Searches an input string for a substring that matches a regular ... You can determine whether the regular expression pattern has been found...
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