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

Youtube doesn't seem to work anymore. "Unable to download webpage" #11545

Closed
aaruni96 opened this issue Dec 27, 2016 · 18 comments
Closed

Youtube doesn't seem to work anymore. "Unable to download webpage" #11545

aaruni96 opened this issue Dec 27, 2016 · 18 comments
Labels

Comments

@aaruni96
Copy link

@aaruni96 aaruni96 commented Dec 27, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.12.22. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • [x ] I've verified and I assure that I'm running youtube-dl 2016.12.22

Before submitting an issue make sure you have:

  • [ x] At least skimmed through README and most notably FAQ and BUGS sections
  • [ x] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • [ x] Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -f 18 jsyk3p0HTLw -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-f', u'18', u'jsyk3p0HTLw', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.22
[debug] Python version 2.7.6 - Linux-4.4.0-57-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6
[debug] Proxy map: {}
[youtube] jsyk3p0HTLw: Downloading webpage
ERROR: Unable to download webpage: [Errno 1] _ssl.c:1429: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number (caused by SSLError(1, '_ssl.c:1429: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number')); 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 405, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1041, in https_open
    req, **kwargs)
  File "/usr/lib/python2.7/urllib2.py", line 1187, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1089, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 444, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 400, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/lib/python2.7/ssl.py", line 341, in recv
    return self.read(buflen)
  File "/usr/lib/python2.7/ssl.py", line 260, in read
    return self._sslobj.read(len)

Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

Downloading from youtube doesn't work after updating to current version. Please fix.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 27, 2016

Could you paste the output of the following 3 commands?

openssl s_client -connect www.youtube.com:443
openssl version
python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 28, 2016

$ openssl s_client -connect www.youtube.com:443
CONNECTED(00000003)
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com
   i:/C=US/O=Google Inc/CN=Google Internet Authority G2
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority G2
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIH0jCCBrqgAwIBAgIIVnW85e/YrWkwDQYJKoZIhvcNAQELBQAwSTELMAkGA1UE
BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl
cm5ldCBBdXRob3JpdHkgRzIwHhcNMTYxMjE1MTM0ODI3WhcNMTcwMzA5MTMzNTAw
WjBmMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN
TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEVMBMGA1UEAwwMKi5n
b29nbGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqHGBLkAX
plf+b9uVIVzWJCZUmCpI61KORGZuCvejve2gAGR5F9wAYkK/VF+mcP6hvj3F8hDo
HD++UKwXkMN8gOaDMyTJqFgFvZWbxQ1NG/lUnR2eFjSdnxktbNBlbbbXmqYJu1yN
34J7i45FCkp8n6yc+4xn41dadf4188i3g/BlaTDeJmHsEQpYNrScrr2KeUyx8xGr
fOEDKPOGGmxVmWxjr80+A7MubRoNskxFBHTu0cUUv0KPopaqAIjxM2OtNgRMB6Sf
C+hW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
G2RldmVsb3Blci5hbmRyb2lkLmdvb2dsZS5jboIEZy5jb4IGZ29vLmdsghRnb29n
bGUtYW5hbHl0aWNzLmNvbYIKZ29vZ2xlLmNvbYISZ29vZ2xlY29tbWVyY2UuY29t
ggp1cmNoaW4uY29tggp3d3cuZ29vLmdsggh5b3V0dS5iZYILeW91dHViZS5jb22C
FHlvdXR1YmVlZHVjYXRpb24uY29tMGgGCCsGAQUFBwEBBFwwWjArBggrBgEFBQcw
AoYfaHR0cDovL3BraS5nb29nbGUuY29tL0dJQUcyLmNydDArBggrBgEFBQcwAYYf
aHR0cDovL2NsaWVudHMxLmdvb2dsZS5jb20vb2NzcDAdBgNVHQ4EFgQUz61JUCag
/oyz2ifZJB5pEL9wWHswDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRK3QYWG7z2
aLV29YG2u2IaulqBLzAhBgNVHSAEGjAYMAwGCisGAQQB1nkCBQEwCAYGZ4EMAQIC
MDAGA1UdHwQpMCcwJaAjoCGGH2h0dHA6Ly9wa2kuZ29vZ2xlLmNvbS9HSUFHMi5j
cmwwDQYJKoZIhvcNAQELBQADggEBAFk/zR3rf5g59BeU4VZ8fSc/cSQVtk+EjONY
b3rM8+Xqid9e/ishcELixKDQwNlsm0sppuEkG3fb9DQZgrdvRXG+66YsQWQkeVdr
LUvwRzNrXGh+R7B0fFsd6ASwuRv2u1KDC0KwGrY2x6GXEIfItvs9Rtwb2zoNpndc
9TyOGr5zgxWRIRrYibQsBe2xrBWBFlp/nBsJjmA/aHwy27X9NAXaCT7LuDAOZ9T1
+P2wk5nF8yzC+A4MBQw7CUIHgjQ0r+SJNqmcO6vMRvOdFGi7kICSnqPccNQ0X/86
E2vlaYBKyg4A+NuV4hSxAmxza3j1cB+jkz5muR3sgVOE9ZenfzY=
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com
issuer=/C=US/O=Google Inc/CN=Google Internet Authority G2
---
No client certificate CA names sent
---
SSL handshake has read 4577 bytes and written 421 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 33645614BB45B5D4BA6E313FDD6C245DC05348396C395130D9DC04DCA8F39A03
    Session-ID-ctx: 
    Master-Key: 94E9EBBBD38F8AE0488F570B0C7E6CF1DAF42FBF73B77064BD97BDA7820477ED637B704CB3ED2C292B4ABF0600826EF1
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 100800 (seconds)
    TLS session ticket:
    0000 - 60 81 b9 6b 8a 3b 30 0f-50 bc 0b 16 de 4b b2 e3   `..k.;0.P....K..
    0010 - 20 6d 1d b7 0f 79 13 be-60 04 ef d5 08 19 9e c5    m...y..`.......
    0020 - 16 fa f8 6a 99 10 b1 14-51 31 37 62 3b e1 69 fa   ...j....Q17b;.i.
    0030 - 23 31 5a 05 c5 e8 f3 ed-90 6a bb 1d cb 5a f0 05   #1Z......j...Z..
    0040 - 86 6e 30 e8 a6 26 0d 33-15 9c 22 4d 08 64 79 bd   .n0..&.3.."M.dy.
    0050 - 99 da d7 49 33 52 4a 98-26 60 0c 1f fd e2 12 62   ...I3RJ.&`.....b
    0060 - 70 39 21 ba 0b 0a 83 64-ab 61 80 21 69 b9 6a 61   p9!....d.a.!i.ja
    0070 - 77 87 7a bd 5e f2 a0 84-82 a0 e9 be f7 15 c1 56   w.z.^..........V
    0080 - 74 e0 37 cf ad 98 d4 76-61 82 19 08 d2 45 d7 71   t.7....va....E.q
    0090 - 6e b0 91 fa 0e 12 e7 22-24 c2 6e 85 38 df 04 d2   n......"$.n.8...
    00a0 - d2 b1 e1 63                                       ...c

    Start Time: 1482902748
    Timeout   : 300 (sec)
    Verify return code: 20 (unable to get local issuer certificate)
---
read:errno=0
$ openssl version
OpenSSL 1.0.1f 6 Jan 2014
$ python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.1f 6 Jan 2014
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 28, 2016

Seems the error is different now. Could you try video downloading again?

@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 28, 2016

$ youtube-dl -f 18 jsyk3p0HTLw
[youtube] jsyk3p0HTLw: Downloading webpage
ERROR: Unable to download webpage: [Errno 1] _ssl.c:1429: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number (caused by SSLError(1, '_ssl.c:1429: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number')); 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.

With the verbose flag :

$ youtube-dl -f 18 jsyk3p0HTLw -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-f', u'18', u'jsyk3p0HTLw', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.22
[debug] Python version 2.7.6 - Linux-4.4.0-57-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6
[debug] Proxy map: {}
[youtube] jsyk3p0HTLw: Downloading webpage
ERROR: Unable to download webpage: [Errno 1] _ssl.c:1429: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number (caused by SSLError(1, '_ssl.c:1429: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number')); 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 405, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1041, in https_open
    req, **kwargs)
  File "/usr/lib/python2.7/urllib2.py", line 1187, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1089, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 444, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 400, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/lib/python2.7/ssl.py", line 341, in recv
    return self.read(buflen)
  File "/usr/lib/python2.7/ssl.py", line 260, in read
    return self._sslobj.read(len)
@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 30, 2016

Bump ?

@Hrxn
Copy link

@Hrxn Hrxn commented Dec 30, 2016

jsyk3p0HTLw works for me...

Did you try to update OpenSSL?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 30, 2016

@Hrxn openssl s_client can connect (just with some certificate verification errors) but Python can't, so I guess the problem is in Python instead of OpenSSL.

@aaruni96 Could you try Python 3.x or Python > 2.7.9? 2.7.6 is way too old and may contain mysterious bugs.

By the way,

Downloading from youtube doesn't work after updating to current version.

Do you remember which version works?

@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 30, 2016

@yan12125 : how do I select which python version to use? AFAIK, I have both python2.7 and python3 installed in my Ubuntu.

I don't really remember which version used to work. Does the -U command have a log somewhere ?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 30, 2016

Try: python3 /usr/local/bin/youtube-dl

Does the -U command have a log somewhere ?

Unfortunately, no

@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 30, 2016

Ah, works nicely with python 3. How to make python3 default ?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 30, 2016

How to make python3 default ?

Adding this to ~/.bashrc should work:

alias youtube-dl="python3 /usr/local/bin/youtube-dl"
@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 30, 2016

No way to change the program itself to use python3 as default?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 30, 2016

No way to change the program itself to use python3 as default?

A possible solution is removing /usr/local/bin/youtube-dl and installing youtube-dl with pip3. See https://github.com/rg3/youtube-dl/blob/master/README.md#installation for more details

@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 30, 2016

I can see the shebang line if I try to view the executable as plain text. Won't it use python3 if I change something in there?

image

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 30, 2016

That works, but changes to the shebang will be overridden the next time you run an update (youtube-dl -U)

@aaruni96
Copy link
Author

@aaruni96 aaruni96 commented Dec 30, 2016

Okay, I'd say the issue is resolved. Close thread ?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 30, 2016

Feel free to close it if you don't want Python 2 support for youtube-dl

@Fabrimat Fabrimat mentioned this issue Jan 10, 2017
0 of 4 tasks complete
@vitorgalvao
Copy link
Contributor

@vitorgalvao vitorgalvao commented Apr 15, 2017

I’d say the alias fix is appropriate, and that since @aaruni96 even mentioned it, this can be closed.

@yan12125 yan12125 closed this Apr 15, 2017
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
4 participants
You can’t perform that action at this time.