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

Unable to download webpage #6257

Closed
mahdiG opened this issue Jul 17, 2015 · 9 comments
Closed

Unable to download webpage #6257

mahdiG opened this issue Jul 17, 2015 · 9 comments

Comments

@mahdiG
Copy link

@mahdiG mahdiG commented Jul 17, 2015

I used to download from youtube but it gives me errors now. I have python3.4.3+ but it seems youtube-dl uses python 2.7.10.

mahdi@JackJack:~$ youtube-dl --verbose -F https://www.youtube.com/watch?v=XxWU-09R1SM
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'-F', u'https://www.youtube.com/watch?v=XxWU-09R1SM']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.07.07
[debug] Python version 2.7.10 - Linux-4.0.0-2-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] XxWU-09R1SM: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [Errno 104] Connection reset by peer> (caused by URLError(error(104, 'Connection reset by peer'),))
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 312, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1729, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 717, in https_open
req, *_kwargs)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 17, 2015

Can you watch the video in browsers directly?

@mahdiG
Copy link
Author

@mahdiG mahdiG commented Jul 17, 2015

Not without a proxy and I've tried setting up a proxy for youtube-dl too and it doesn't work. But my brother who uses the same ISP can download youtube videos even without proxy. I could do it before too but now I can't.

@mahdiG
Copy link
Author

@mahdiG mahdiG commented Jul 17, 2015

Sometimes I get an error different from the first one.

mahdi@JackJack:~$ youtube-dl --verbose -F https://www.youtube.com/watch?v=Ss39UktpXk0
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'-F', u'https://www.youtube.com/watch?v=Ss39UktpXk0']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.07.07
[debug] Python version 2.7.10 - Linux-4.0.0-2-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] Ss39UktpXk0: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)'),))
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 312, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1729, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 717, in https_open
req, *_kwargs)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 18, 2015

What's the error message when using a proxy with youtube-dl?

@mahdiG
Copy link
Author

@mahdiG mahdiG commented Jul 21, 2015

After reading http://unix.stackexchange.com/questions/71481/use-socks-proxy-for-commands-in-terminal I used this command:

export http_proxy=socks5://127.0.0.1:8080 https_proxy=socks5://127.0.0.1:8080

And then:

mahdi@JackJack:~$ youtube-dl --verbose --proxy 127.0.0.1:1080 -F https://www.youtube.com/watch?v=JG9c3uF8NbY
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--proxy', u'127.0.0.1:1080', u'-F', u'https://www.youtube.com/watch?v=JG9c3uF8NbY']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.07.18
[debug] Python version 2.7.10 - Linux-4.0.0-2-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: none
[debug] Proxy map: {u'http': u'127.0.0.1:1080', u'https': u'127.0.0.1:1080'}
[youtube] JG9c3uF8NbY: Downloading webpage
ERROR: Unable to download webpage: '' (caused by BadStatusLine("''",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 314, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1731, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 717, in https_open
req, *_kwargs)
File "/usr/lib/python2.7/urllib2.py", line 1194, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "/usr/lib/python2.7/httplib.py", line 1052, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1092, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1048, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 892, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 854, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1265, in connect
HTTPConnection.connect(self)
File "/usr/lib/python2.7/httplib.py", line 834, in connect
self._tunnel()
File "/usr/lib/python2.7/httplib.py", line 811, in _tunnel
(version, code, message) = response._read_status()
File "/usr/lib/python2.7/httplib.py", line 417, in _read_status
raise BadStatusLine(line)

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 21, 2015

socks5 proxies are not supported yet. See #402.

@mahdiG
Copy link
Author

@mahdiG mahdiG commented Jul 21, 2015

I know :-/ that's why I googled it. I use a SSH connection. But my point is, I used to download videos without any proxy as my brother does right now

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 21, 2015

Sorry if you can't watch the video in browsers, youtube-dl can't help more.

@mahdiG
Copy link
Author

@mahdiG mahdiG commented Oct 22, 2015

I switched to Ubuntu 14.04 and now it works, despite being unable watch the videos in youtube.com

@mahdiG mahdiG closed this Oct 22, 2015
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.