Closed firedm closed 4 years ago
Solve cloudflare CAPTCHA and pass cookies.
i can open and play this file on web browser, it never ask for CAPTCHA, i did export a cookie file and get same error 403 forbidden i understand this is a server response but my question is why the executable "youtube-dl.exe" succeeded without any extra parameters or cookies? and a PyPi version fails
output using cookies
$ python -m youtube_dl -F -v --cookies "C:\Users\mea\Desktop\test\cookies.txt" "https://www.crunchyroll.com/en-gb/mob-psycho-100/mob-psycho-100-ii-unknown-789
119"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-F', '-v', '--cookies', 'C:\\Users\\mea\\Desktop\\test\\cookies.txt', 'https://www.crunchyroll.com/en-gb/mob-psycho-100/mob-psych
o-100-ii-unknown-789119']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.06.06
[debug] Python version 3.6.0 (CPython) - Windows-8.1-6.3.9600-SP0
[debug] exe versions: ffmpeg git-2020-01-24-e931119
[debug] Proxy map: {}
[crunchyroll] 789119: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on https://yt-dl.org/bug . Mak
e 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 c
omplete output.
File "C:\Python\Python36-32\lib\site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "C:\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 2238, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "C:\Python\Python36-32\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\Python\Python36-32\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python\Python36-32\lib\urllib\request.py", line 564, in error
result = self._call_chain(*args)
File "C:\Python\Python36-32\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\Python\Python36-32\lib\urllib\request.py", line 756, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "C:\Python\Python36-32\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\Python\Python36-32\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python\Python36-32\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "C:\Python\Python36-32\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\Python\Python36-32\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
Exe version uses different python version thus different version of urllib. This may result in some differences in how requests are processed internally, for example in the order HTTP headers are sent, that may trigger cloudflare heuristics.
Thanks for explanation
Checklist
Verbose log
Description
youtube-dl installed via pypi failed to process "crunchyroll" urls but youtube-dl.exe works fine
also tried to download source from github and run same command and i get the same above error
C:\Users\mea\Desktop\test\youtube-dl-master\youtube_dl>python __main__.py -F -v "https://www.crunchyroll.com/en-gb/mob-psycho-100/mob-psycho-100-ii-unknown-789119"
it works only with youtube-dl.exe on windows this is the output: