-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Error 429: Too Many Requests #72
Comments
I will investigate this, my apologies for the delay. |
I tested this on python 3.6, 3.7, 3.8 and I got no errors. Have you made any modifications and have you installed it the correct way? |
No, I have not made any changes. Just following instructions in readme.md. Then in my code file I have Using Python 3.6.8 on Ubuntu 18.04 |
Does it raise this error every time? Does it raise this error for every video? This error code seems strange, kind of specific. |
The error occurs like 95% of the time and yes for every video. |
I have used a new installation of Python 3.6.8 with Linux Mint 19.3 (which is based on Ubuntu 18.04), and have been totally unable to replicate this issue. Once I had installed Python 3.6.8, I created a venv by running
then activated the test environment with
then installed pytube and updated to pytube3
then I just ran the script and had no errors. I was able to download whatever youtube video I wanted. Let me know how this goes anyway, I am eager to get this working for you. |
I tried using VPN and got the same error. youtube-dl also not working. So I guess it's my internet, is there anything that I can do about to make this work? |
Is there anything you can do? Probably, but this is a little bit out of my knowledge 🤔. Which VPN are you using? And which country is your server in? I think it needs to be another country. |
I am using Proton VPN, connected to fastest available server which happened to be in Netherlands. |
I'm really sorry, I don't know how to help at the moment. Maybe try asking on some other website? People who know more about networks and the internet? I will keep thinking about this, if anything comes to mind I will post a reply here. |
I have been doing some research, when you use youtube-dl have you tried using the flag |
Youtube-dl and pytube both works on local server but on a live website when you try downloading more then 3-4 videos it shows this error. I have been searching for the solution....iI found this but don't know how to do Check this |
youtube-dl worked after using the flag |
And now everything is working. I have tried 6 different videos with youtube-dl and it's working fine with and without |
@bigsandip When you say local server I don't know what you mean, is that a VPN? And about the solution you linked, I have never gone through the code in youtube-dl so I'm not sure how that program works. By the looks of it, you can save cookies in a config file. There is no option to do that in pytube currently, I will research this and see if I can add something similar in the future if it works for you. Did you try using the flag |
@arslandogar Well that is good everything is working now! I only know how pytube works, I thought I knew the basics of networks too but it looks like I need to do more research before I understand why this was not working for you. |
@swiftyy-mage I mean on |
@swiftyy-mage How do i use
|
@bigsandip I think it is just a command line flag, you just type it in as an argument when you use youtube-dl. I have never used youtube-dl though. I recommend trying to use a VPN. |
In case this could help, I ran this on my local computer without any VPN, no specific issues here:
|
Try using this method: https://github.com/kazanture/YouPy |
But I am using Heroku 😳😕 |
This piece of code
from pytube import YouTube
yt = YouTube('https://www.youtube.com/watch?v=tPEE9ZwTmy0')
Throws this error:
Traceback (most recent call last):
File "test.py", line 2, in
yt = YouTube('https://www.youtube.com/watch?v=tPEE9ZwTmy0')
File "/home/user/.local/lib/python3.6/site-packages/pytube/main.py", line 91, in init
self.prefetch()
File "/home/user/.local/lib/python3.6/site-packages/pytube/main.py", line 162, in prefetch
self.watch_html = request.get(url=self.watch_url)
File "/home/user/.local/lib/python3.6/site-packages/pytube/request.py", line 36, in get
return _execute_request(url).read().decode("utf-8")
File "/home/user/.local/lib/python3.6/site-packages/pytube/request.py", line 24, in _execute_request
return urlopen(request) # nosec
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 564, in error
result = self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 429: Too Many Requests
The text was updated successfully, but these errors were encountered: