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

Error while using an HTTP proxy server without HTTP/1.0 support #22610

Closed
lamg opened this issue Oct 4, 2019 · 1 comment
Closed

Error while using an HTTP proxy server without HTTP/1.0 support #22610

lamg opened this issue Oct 4, 2019 · 1 comment

Comments

@lamg
Copy link

@lamg lamg commented Oct 4, 2019

  • I've verified that I'm running youtube-dl version 2019.09.28
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl -v https://youtu.be/nmoMGP3zn_k
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://youtu.be/nmoMGP3zn_k']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.09.28
[debug] Python version 2.7.15+ (CPython) - Linux-4.15.0-58-generic-x86_64-with-LinuxMint-19-tara
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {'http': 'http://10.2.4.70:8081/', 'https': 'http://10.2.4.70:8081/', 'no': 'localhost,127.0.0.0/8,::1,*.upr.edu.cu,10.2.0.0/16'}
[youtube] nmoMGP3zn_k: Downloading webpage
ERROR: Unable to download webpage: <urlopen error Tunnel connection failed: 400 Bad Request> (caused by URLError(error('Tunnel connection failed: 400 Bad Request',),))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2237, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 2724, in https_open
    req, **kwargs)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)

Description

Currently I'm using an HTTP proxy server without HTTP/1.0 support, and since youtube-dl --print-traffic https://youtu.be/3Roz6BVdKcQ prints:

[youtube] 3Roz6BVdKcQ: Downloading webpage
send: u'CONNECT www.youtube.com:443 HTTP/1.0\r\n'
send: '\r\n'
ERROR: Unable to download webpage: <urlopen error Tunnel connection failed: 400 Bad Request> (caused by URLError(error('Tunnel connection failed: 400 Bad Request',),))

I guess that is the problem. My proposal is checking for HTTP/1.1 support before failing to download.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 4, 2019

1.0 is hardcoded in python's httplib. There is no control over it.

@dstftw dstftw closed this Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.