I would so much love to use this!! (So yes, I liked it!) :) But unfortunately I also get an error message. The problem seems to be in line 202 of a file called extract.py
I have been trying to change a little in it, but since my knowledge of Python is still in the basics I don't really want to mess up the file without really knowing what I am doing, so please come with tips on how I can solve the following problem:
File "C:\ProgramData\Anaconda3\lib\site-packages\pytube\extract.py", line 202, in get_ytplayer_config
raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")
RegexMatchError: get_ytplayer_config: could not find match for config_patterns
I have this issue too. I'm using Python 3.9 and in it's own IDLE
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns
Traceback (most recent call last):
File "C:\Users\Kolombo\Desktop\pytube.py", line 1, in
from pytube import *
File "C:\Users\Kolombo\Desktop\pytube.py", line 5, in
youtube = pytube.YouTube(url)
NameError: name 'pytube' is not defined
If use that module and it working but sometimes it said http error. When i try 3/4 timeβs then it working. I donβt know why i am facing this problem. And also i get only 360p high resolution video with audio. Have any solutions on this module.
Top comments (18)
i getting this error:
AttributeError: partially initialized module 'pytube' has no attribute 'YouTube' (most likely due to a circular import)
My file:
`import pytube
print("Give URL:")
url = 'input()'
pytube.YouTube(url).streams.get_highest_resolution().download()`
I'm getting the same error.. python 3.8, using pytube3 library.
update: it worked after I uninstall then reinstall pytube3, I think you must install pytube3 in the first place and don't try to install pytube.
Have you download the module?
With this command - > pip install pytube
That was the first thing I did.
Try to install pytube3 (sometimes is need it)
Still Nothing;
youtube = pytube.YouTube(url)
AttributeError: partially initialized module 'pytube' has no attribute 'YouTube' (most likely due to a circular import)
I got this error: ImportError: cannot import name 'quote' from 'pytube.compat'. Then I installed pytube3 - now it works. Thank you a lot :)
Hi,
verify that the name of your script is not "pytube.py"
That was the first thing I did
I would so much love to use this!! (So yes, I liked it!) :) But unfortunately I also get an error message. The problem seems to be in line 202 of a file called extract.py
I have been trying to change a little in it, but since my knowledge of Python is still in the basics I don't really want to mess up the file without really knowing what I am doing, so please come with tips on how I can solve the following problem:
File "C:\ProgramData\Anaconda3\lib\site-packages\pytube\extract.py", line 202, in get_ytplayer_config
raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")
RegexMatchError: get_ytplayer_config: could not find match for config_patterns
With kind regards,
Marie
I think you're using an old version of pytube. Please run the following to uninstall pytube, and then reinstall it from the source code:
python -m pip uninstall pytube pytube3 pytubex
python -m pip install git+github.com/nficano/pytube
I had the same problem last week and i have solved it with above instructions.
I have this issue too. I'm using Python 3.9 and in it's own IDLE
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns
I am getting an error:
Traceback (most recent call last):
File "C:\Users\Kolombo\Desktop\pytube.py", line 1, in
from pytube import *
File "C:\Users\Kolombo\Desktop\pytube.py", line 5, in
youtube = pytube.YouTube(url)
NameError: name 'pytube' is not defined
from code:
from pytube import *
url = 'youtube.com/watch?v=4SFhwxzfXNc'
youtube = pytube.YouTube(url)
video = youtube.streams.first()
video.download()
If use that module and it working but sometimes it said http error. When i try 3/4 timeβs then it working. I donβt know why i am facing this problem. And also i get only 360p high resolution video with audio. Have any solutions on this module.
at first, I had this error:
RegexMatchError: get_ytplayer_config: could not find match for config_patterns
I did some reinstalling, then it was able to get the video, but now a new error:
KeyError: 'content-length'
The problem's
get_highest_resolution() will look for videos that have the codec for audio, not the highest quality video
example
720p
480p
360p
140p
if you use the get_highest_resolution function, and only 360p and 140p are available (for audio codecs) .. then 360p is selected.
According to my observations, downloadable videos with video + audio are just under 480p
the rest will be forced to use video compress like ffmpeg
Thanks George! Been a while since I downloaded some vids with Python, maybe this'll be my motivation to get back into it π
Bem simples de usar. Funcionou comigo dessa forma:
import pytube
url = 'youtube.com/watch?v=xva71wynxS0'
youtube = pytube.YouTube(url)
video = youtube.streams.first()
video.download()