Skip to content
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

Stop ignoring "HTTP Error 429: Too Many Requests" bug reports [discussion] #21729

Closed
jonttm opened this issue Jul 11, 2019 · 20 comments
Closed

Comments

@jonttm
Copy link

jonttm commented Jul 11, 2019

YouTube changed something yesterday that automatically blocks requests from youtube-dl depending on the situation. Read about several popular sites going down: https://streamdroid.org/youtube-blocks-popular-mp3-stream-ripping-sites/

My site was affected too and I created several new servers (all with fresh IP addresses) and all of them were blocked as soon as the first request from youtube-dl hit.

This is not just "your server was blocked by YouTube, end of discussion" issue. I can't create a new server and set up the website again.

Please look into these bug reports and discover what YouTube has done to automatically detect youtube-dl. It has to be automatic because it happens the instant you attempt to download a video from a new server.

Here's my relevant error log from my latest server instance:

jonttm@Server:/var/log/apache2$ youtube-dl -v https://www.youtube.com/watch?v=pQioCb4KUHM
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=pQioCb4KUHM']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 3.6.8 (CPython) - Linux-4.15.0-52-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6-0ubuntu0.18.04.1, ffprobe 3.4.6-0ubuntu0.18.04.1, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
[youtube] pQioCb4KUHM: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by <HTTPError 429: 'Too Many Requests'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/lib/python3/dist-packages/youtube_dl/extractor/common.py", line 519, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 2199, in urlopen
return self._opener.open(req, timeout=self._socket_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)

More information:
I later installed youtube-dl.exe on my personal Windows computer and it worked just fine. The only correlation with this bug is that all these instances were running Ubuntu Server 18.04 and using DigitalOcean as a host. I will continue testing with different hosts and other operating systems to see if that matters.

@jonttm jonttm changed the title Stop ignoring "HTTP Error 429: Too Many Requests" bug reports Stop ignoring "HTTP Error 429: Too Many Requests" bug reports [discussion] Jul 11, 2019
@alejandro-zapeta
Copy link

alejandro-zapeta commented Jul 11, 2019

Hi i have the same issue, also put a "new issue" but i have been marked as "duplicated".
I were reading that to fix that you have to use "ipv4" (but the comments are about 2012-2014)
I put:
youtube-dl --force-ipv4 (also the same error).
I put:
youtube-dl --force-ipv6 (and says these: ERROR: Unable to download webpage: <urlopen error [Errno 99] Cannot assign requested address> (caused by URLError(error(99, 'Cannot assign requested address'),)) )

Could someone help us?

@dstftw
Copy link
Collaborator

dstftw commented Jul 11, 2019

Again: Youtube ban entire IPv6 blocks. You don't even need to ever run youtube-dl to get your "fresh" IP banned. It does not detect youtube-dl, if you run browser you'll get the same 429.

@alejandro-zapeta
Copy link

Ok, i don't have clear the solution. Please help me.

@jonttm
Copy link
Author

jonttm commented Jul 11, 2019

@dstftw I appreciate the mention of "IPv6." I wasn't aware of this being the cause of the problem before. Specifying --force-ipv4 in the command has fixed the problem. I wonder where they got these blocks of addresses? Now I will just have to apply this fix to my website.

@alejandro-zapeta
Copy link

Really? i cant fix my problem :( still the same error. I will try to connect via VCN and open a webbrowser hoping appear the "are you a robot" captcha... :(

@jonttm
Copy link
Author

jonttm commented Jul 11, 2019

Maybe try disabling all IPv6 connectivity to your device?

@alejandro-zapeta
Copy link

How can i do that? (i am using ubuntu btw)

@jonttm
Copy link
Author

jonttm commented Jul 11, 2019 via email

@alejandro-zapeta
Copy link

HAHA ok thnks

@Hrxn
Copy link

Hrxn commented Jul 11, 2019

This was the piece of critical information missing from most (if not all) "bug" reports:

all these instances were running Ubuntu Server 18.04 and using DigitalOcean as a host

@LyoSU
Copy link

LyoSU commented Jul 11, 2019

Again: Youtube ban entire IPv6 blocks. You don't even need to ever run youtube-dl to get your "fresh" IP banned. It does not detect youtube-dl, if you run browser you'll get the same 429.

This is not a solution. I have ipv6 disabled on my server, but I still get this error. It appeared relatively recently. There are options?

@dstftw
Copy link
Collaborator

dstftw commented Jul 11, 2019

There is no special black magic. You either use not banned outgoing IP (be it your direct network interface, proxy, VPN or whatever) or it will not work.

@alejandro-zapeta
Copy link

Hi @LyoSU Have you resolved? Please help. I don't understand how to solve it.

@LyoSU
Copy link

LyoSU commented Jul 11, 2019

Hi @LyoSU Have you resolved? Please help. I don't understand how to solve it.

I tried to use a proxy and it helped me. Looks like you just need to change the server.

@alejandro-zapeta
Copy link

@LyoSU THanks for your replied. Ok i will try something like Proxy or change server.

@alejandro-zapeta
Copy link

Hi! if someone needs. My Problem has been "fixed". I only stop to do "requests" to youtube with YouTube-dl, perhaps for 10 to 16 hours. And now it's working fine.
:)
Have a nice day!

@LyoSU
Copy link

LyoSU commented Jul 11, 2019

@zapetin52 This is not a fix. I have the same and after a couple of dozen requests are blocked again.

@alejandro-zapeta
Copy link

Ok i unterstand it's not a fix, but for me it's working again. If youtube will block me in the future i will use another IP or a Proxy. I think i will change the IP ( i don't know )

@sherlock-tez
Copy link

Here is my tries:

  1. Sleep my server for 24 hours, then come back to use youtube-dl. After 1 hour using, the error occurs again.
  2. Set delay time between request is from 60 to 100 seconds. After 2 hours, the error occurs again.

YouTube changed something yesterday that automatically blocks requests from youtube-dl depending on the situation. -> I agree.

@alejandro-zapeta
Copy link

My "solution" was paid for another IP. Hoping working for a long long time. Thanks for the support

@ytdl-org ytdl-org locked and limited conversation to collaborators Jul 13, 2019
@ytdl-org ytdl-org deleted a comment from francesco2013 Jul 13, 2019
@ytdl-org ytdl-org deleted a comment from websaz2000 Jul 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants