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.

[BUG] RegexMatchError('__init__: could not find match for ^\\w+\\W')

See original GitHub issue

Before creating an issue

confirmed I on the latest version of pytube by installing from the source.

Describe the bug Error trying to get URL for video (<class 'pytube.exceptions.RegexMatchError'>, RegexMatchError('__init__: could not find match for ^\\w+\\W')

To Reproduce Please provide the following information:

Expected behavior It should be able to provide the URL to download the video

Output

  File "/Users/par/Dev/mememaker-web/mememaker/views/resolver.py", line 273, in resolve_image_url
    thevid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first()
  File "/Users/par/.virtualenvs/mememaker/lib/python3.9/site-packages/pytube/__main__.py", line 296, in streams
    return StreamQuery(self.fmt_streams)
  File "/Users/par/.virtualenvs/mememaker/lib/python3.9/site-packages/pytube/__main__.py", line 188, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "/Users/par/.virtualenvs/mememaker/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature
    cipher = Cipher(js=js)
  File "/Users/par/.virtualenvs/mememaker/lib/python3.9/site-packages/pytube/cipher.py", line 33, in __init__
    raise RegexMatchError(
pytube.exceptions.RegexMatchError: __init__: could not find match for ^\w+\W

System information Please provide the following information:

  • Python version 3.99
  • Pytube version 12.1.0
  • Command used to install pytube: python -m pip install git+https://github.com/pytube/pytube

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:17
  • Comments:18

github_iconTop GitHub Comments

18reactions
lloveqtinfocommented, Jun 2, 2022

Hey, found this issue in an earlier thread - here is the link to the thread:

https://github.com/pytube/pytube/issues/1199#issuecomment-1016783092

“” I just updated the regex like this and it’s working: ^\$*\w+\W “”

sorry had to edit - the image alone was not specific at all, note the change implemented on line 30 of cipher.py: image

14reactions
AlexanderMelnikovcommented, Jun 2, 2022

One slash was cuted in answer above. Correct: ^\$*\w+\W

This fix helped me. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytube.exceptions.RegexMatchError: __init__: could not find ...
so my issue is I run this simple code to attempt to make a pytube stream object... from pytube import YouTube yt =...
Read more >
[Solved] pytube.exceptions.RegexMatchError: __init__: could ...
To Solve pytube.exceptions.RegexMatchError: init: could not find match for ^w+W Error First Of All Open Your cipher.py File Which is locate.
Read more >
[BUG] RegexMatchError ? · Issue #1199 · pytube ... - GitHub
got the same error, is it because of the new version? (the error: pytube.exceptions.RegexMatchError: init: could not find match for ^\w+\W) ...
Read more >
pytube.exceptions.RegexMatchError: __init__: could not find ...
Solved — pytube.exceptions.RegexMatchError: __init__: could not find match for ^\w+\W. RegexMatchError python version: 3.8.10 pytube version: 11.0.2 ...
Read more >
Arthur's Note
[mac] bundle install pg Can't find the 'libpq-fe.h header ... .com/questions/70776558/pytube-exceptions-regexmatcherror-init-could-not-find-match-for-w-w.
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