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

Using `--proxy` crashes with various error messages #21266

Closed
ghost opened this issue May 31, 2019 · 2 comments
Closed

Using `--proxy` crashes with various error messages #21266

ghost opened this issue May 31, 2019 · 2 comments

Comments

@ghost
Copy link

@ghost ghost commented May 31, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.05.20
  • 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

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--proxy', 'socks5://47.91.2.3:1080/', 'BrRHgIRwjFY']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.05.20
[debug] Python version 3.7.3 (CPython) - Linux-5.1.4-arch1-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3, rtmpdump 2.4
[debug] Proxy map: {'http': 'socks5://47.91.2.3:1080/', 'https': 'socks5://47.91.2.3:1080/'}
[youtube] BrRHgIRwjFY: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [Errno 0] Invalid response version from server. Expected 05 got 48> (caused by URLError(InvalidVersionError(0, 'Invalid response version from server. Expected 05 got 48')))
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 626, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 2227, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/site-packages/youtube_dl/utils.py", line 1140, in https_open
    req, **kwargs)
  File "/usr/lib/python3.7/urllib/request.py", line 1319, in do_open
    raise URLError(err)

Sometimes this:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--proxy', 'socks5://192.241.245.207:1080/', 'BrRHgIRwjFY']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.05.20
[debug] Python version 3.7.3 (CPython) - Linux-5.1.4-arch1-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3, rtmpdump 2.4
[debug] Proxy map: {'http': 'socks5://192.241.245.207:1080/', 'https': 'socks5://192.241.245.207:1080/'}
[youtube] BrRHgIRwjFY: Downloading webpage
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 11, in <module>
    load_entry_point('youtube-dl==2019.5.20', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python3.7/site-packages/youtube_dl/__init__.py", line 474, in main
    _real_main(argv)
  File "/usr/lib/python3.7/site-packages/youtube_dl/__init__.py", line 464, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 2008, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 796, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 529, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1643, in _real_extract
    video_webpage = self._download_webpage(url, video_id)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 793, in _download_webpage
    expected_status=expected_status)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 270, in _download_webpage_handle
    *args, **compat_kwargs(kwargs))
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 659, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 626, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 2227, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/site-packages/youtube_dl/utils.py", line 1140, in https_open
    req, **kwargs)
  File "/usr/lib/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/lib/python3.7/site-packages/youtube_dl/utils.py", line 1106, in connect
    self.sock.connect((self.host, self.port))
  File "/usr/lib/python3.7/site-packages/youtube_dl/socks.py", line 270, in connect
    self._make_proxy(socket.socket.connect, address)
  File "/usr/lib/python3.7/site-packages/youtube_dl/socks.py", line 266, in _make_proxy
    setup_funcs[self._proxy.type](address)
  File "/usr/lib/python3.7/site-packages/youtube_dl/socks.py", line 235, in _setup_socks5
    version, status, reserved, atype = self._recv_bytes(4)
  File "/usr/lib/python3.7/site-packages/youtube_dl/socks.py", line 131, in _recv_bytes
    data = self.recvall(cnt)
  File "/usr/lib/python3.7/site-packages/youtube_dl/socks.py", line 126, in recvall
    raise EOFError('{0} bytes missing'.format(cnt - len(data)))

Description

When trying to download a geo-restricted video from YouTube using the --proxy parameter youtube-dl crashes with one of the messages seen in the two logs above. It is not relevant what geo-restricted video I try and it is not relevant what proxy I try. Proxy works in browser but I always get either the first or the second message in youtube-dl.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 31, 2019

Most likely proxies are broken/misbehave/non-socks5.

@dstftw dstftw closed this May 31, 2019
@ghost
Copy link
Author

@ghost ghost commented May 31, 2019

Proxies work properly in other applications.

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
1 participant
You can’t perform that action at this time.