[BUG] RegexMatchError('__init__: could not find match for ^\\w+\\W')
See original GitHub issueBefore 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:
- The video url that is causing the error: https://www.youtube.com/watch?v=Y4-GSFKZmEg
- pytube.exceptions.RegexMatchError
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:
- Created a year ago
- Reactions:17
- Comments:18
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
One slash was cuted in answer above. Correct:
^\$*\w+\W
This fix helped me. Thank you.