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 gameinformer.com's video due to its SSL error. #9618

Open
antdude opened this issue May 28, 2016 · 11 comments
Open

Unable to download gameinformer.com's video due to its SSL error. #9618

antdude opened this issue May 28, 2016 · 11 comments

Comments

@antdude
Copy link

@antdude antdude commented May 28, 2016

$ youtube-dl -v http://www.gameinformer.com/b/features/archive/2016/05/27/replay-the-matrix-path-of-neo.aspx
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.gameinformer.com/b/features/archive/2016/05/27/replay-the-matrix-path-of-neo.aspx']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.05.21.2
[debug] Python version 3.4.2 - Linux-3.16.0-4-amd64-x86_64-with-debian-8.4
[debug] exe versions: ffmpeg 2.8.6-1, ffprobe 2.8.6-1, rtmpdump 2.4
[debug] Proxy map: {}
[GameInformer] replay-the-matrix-path-of-neo: Downloading webpage
[brightcove:new] 4915937021001: Downloading webpage
[brightcove:new] 4915937021001: Downloading JSON metadata
[brightcove:new] 4915937021001: Downloading m3u8 information
[brightcove:new] 4915937021001: Downloading m3u8 information
[debug] Invoking downloader on 'https://secure.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=4916032574001&secure=true&pubId=694940074001&videoId=4915937021001'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 394
[download] Destination: Replay - The Matrix - Path of Neo-4915937021001.mp4
ERROR: unable to download video data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
Traceback (most recent call last):
File "/usr/lib/python3.4/urllib/request.py", line 1174, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.4/http/client.py", line 1090, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.4/http/client.py", line 1128, in _send_request
self.endheaders(body)
File "/usr/lib/python3.4/http/client.py", line 1086, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.4/http/client.py", line 924, in _send_output
self.send(msg)
File "/usr/lib/python3.4/http/client.py", line 859, in send
self.connect()
File "/usr/lib/python3.4/http/client.py", line 1230, in connect
server_hostname=sni_hostname)
File "/usr/lib/python3.4/ssl.py", line 364, in wrap_socket
_context=self)
File "/usr/lib/python3.4/ssl.py", line 577, in init
self.do_handshake()
File "/usr/lib/python3.4/ssl.py", line 804, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ant/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1644, in process_info
success = dl(filename, info_dict)
File "/home/ant/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1586, in dl
return fd.download(name, info)
File "/home/ant/bin/youtube-dl/youtube_dl/downloader/common.py", line 350, in download
return self.real_download(filename, info_dict)
File "/home/ant/bin/youtube-dl/youtube_dl/downloader/hls.py", line 77, in real_download
success = ctx['dl'].download(frag_filename, {'url': frag_url})
File "/home/ant/bin/youtube-dl/youtube_dl/downloader/common.py", line 350, in download
return self.real_download(filename, info_dict)
File "/home/ant/bin/youtube-dl/youtube_dl/downloader/http.py", line 58, in real_download
data = self.ydl.urlopen(request)
File "/home/ant/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1946, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python3.4/urllib/request.py", line 455, in open
response = self._open(req, data)
File "/usr/lib/python3.4/urllib/request.py", line 473, in _open
'_open', req)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(_args)
File "/home/ant/bin/youtube-dl/youtube_dl/utils.py", line 939, in https_open
req, *_kwargs)
File "/usr/lib/python3.4/urllib/request.py", line 1176, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 28, 2016

What's the output of the following command?

curl -v "https://gamestop-a.akamaihd.net/694940074001/2016/05/4916032574001/694940074001_4916032574001_s-1.ts?pubId=694940074001&videoId=4915937021001" > /dev/null
@antdude
Copy link
Author

@antdude antdude commented May 28, 2016

http://pastie.org/pastes/10856012/text?key=x2867mkzbndczg7wi4azsa OR see below (darn formatting):

$ curl -v "https://gamestop-a.akamaihd.net/694940074001/2016/05/4916032574001/694940074001_4916032574001_s-1.ts?pubId=694940074001&videoId=4915937021001" > /dev/null

  • Hostname was NOT found in DNS cache
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 173.223.52.195...
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to gamestop-a.akamaihd.net (173.223.52.195) port 443 (#0)
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • SSLv3, TLS handshake, Client hello (1):
    } [data not shown]
  • SSLv3, TLS handshake, Server hello (2):
    { [data not shown]
  • SSLv3, TLS handshake, CERT (11):
    { [data not shown]
  • SSLv3, TLS handshake, Server key exchange (12):
    { [data not shown]
  • SSLv3, TLS handshake, Server finished (14):
    { [data not shown]
  • SSLv3, TLS handshake, Client key exchange (16):
    } [data not shown]
  • SSLv3, TLS change cipher, Client hello (1):
    } [data not shown]
  • SSLv3, TLS handshake, Finished (20):
    } [data not shown]
  • SSLv3, TLS change cipher, Client hello (1):
    { [data not shown]
  • SSLv3, TLS handshake, Finished (20):
    { [data not shown]
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
  • Server certificate:
  •    subject: C=US; ST=MA; L=Cambridge; O=Akamai Technologies Inc.; CN=a248.e.akamai.net
    
  •    start date: 2015-08-27 16:10:12 GMT
    
  •    expire date: 2016-08-27 16:10:11 GMT
    
  •    subjectAltName: gamestop-a.akamaihd.net matched
    
  •    issuer: C=NL; L=Amsterdam; O=Verizon Enterprise Solutions; OU=Cybertrust; CN=Verizon Akamai SureServer CA G14-SHA2
    
  •    SSL certificate verify ok.
    

    GET /694940074001/2016/05/4916032574001/694940074001_4916032574001_s-1.ts?pubId=694940074001&videoId=4915937021001 HTTP/1.1
    User-Agent: curl/7.38.0
    Host: gamestop-a.akamaihd.net
    Accept: /

    < HTTP/1.1 200 OK
  • Server Apache is not blacklisted
    < Server: Apache
    < ETag: "525ceb8583e3ae9d4c78ffe72a20657c:1464376388"
    < Last-Modified: Fri, 27 May 2016 19:13:08 GMT
    < Accept-Ranges: bytes
    < Content-Length: 2397564
    < Content-Type: video/mp2t
    < Date: Sat, 28 May 2016 13:32:41 GMT
    < Connection: keep-alive
    < Access-Control-Allow-Headers: X-Requested-With
    < Access-Control-Allow-Origin: *
    <
    { [data not shown]
    100 2341k 100 2341k 0 0 3765k 0 --:--:-- --:--:-- --:--:-- 3764k
  • Connection #0 to host gamestop-a.akamaihd.net left intact
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 28, 2016

Seems working. How about the result of the following Python script? Run it with Python 3.4, the same one for youtube-dl.

import urllib.request

url = 'https://gamestop-a.akamaihd.net/694940074001/2016/05/4916032574001/694940074001_4916032574001_s-1.ts?pubId=694940074001&videoId=4915937021001'
urllib.request.urlopen(url)
@antdude
Copy link
Author

@antdude antdude commented May 28, 2016

How do I do that? I am not familiar with Python very well. FYI. I tried both v3.4 and v2.7.9. :(

http://pastie.org/pastes/10856243/text?key=gle1hs5p6y7scxul7ddoaa OR see below for (autoformat):
$ curl -v "https://gamestop-a.akamaihd.net/694940074001/2016/05/4916032574001/694940074001_4916032574001_s-1.ts?pubId=694940074001&videoId=4915937021001" > /dev/null

  • Hostname was NOT found in DNS cache
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 107.14.47.139...
  • Connected to gamestop-a.akamaihd.net (107.14.47.139) port 443 (#0)
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • SSLv3, TLS handshake, Client hello (1):
    } [data not shown]
  • SSLv3, TLS handshake, Server hello (2):
    { [data not shown]
  • SSLv3, TLS handshake, CERT (11):
    { [data not shown]
  • SSLv3, TLS alert, Server hello (2):
    } [data not shown]
  • SSL certificate problem: unable to get local issuer certificate
  • Closing connection 0
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 28, 2016

There are two identical curl requests, one succeeded and the other failed. Definitely strange. Could you try the curl command more times?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 28, 2016

For the Python script, just save the codes as test_ssl.py and run:

python3 test_ssl.py

The script ends up in silence if everything is OK. Otherwise, a lengthy error message is printed if something goes wrong.

@antdude
Copy link
Author

@antdude antdude commented May 28, 2016

I tried both Python versions and saw:
$ python3 test_ssl.py
$

So, they were OK. :)

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 28, 2016

Is the original video OK, too?

@antdude
Copy link
Author

@antdude antdude commented May 28, 2016

Yan12125: If you mean the original video URL, then it still failed with both Python versions:
$ youtube-dl http://www.gameinformer.com/b/features/archive/2016/05/27/replay-the-matrix-path-of-neo.aspx
[GameInformer] replay-the-matrix-path-of-neo: Downloading webpage
[brightcove:new] 4915937021001: Downloading webpage
[brightcove:new] 4915937021001: Downloading JSON metadata
[brightcove:new] 4915937021001: Downloading m3u8 information
[brightcove:new] 4915937021001: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 394
[download] Destination: Replay - The Matrix - Path of Neo-4915937021001.mp4
ERROR: unable to download video data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>

$ youtube-dl http://www.gameinformer.com/b/features/archive/2016/05/27/replay-the-matrix-path-of-neo.aspx
[GameInformer] replay-the-matrix-path-of-neo: Downloading webpage
[brightcove:new] 4915937021001: Downloading webpage
[brightcove:new] 4915937021001: Downloading JSON metadata
[brightcove:new] 4915937021001: Downloading m3u8 information
[brightcove:new] 4915937021001: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 394
[download] Destination: Replay - The Matrix - Path of Neo-4915937021001.mp4
ERROR: unable to download video data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>

:(

@donizyo
Copy link

@donizyo donizyo commented Jul 11, 2016

I met the same problem when I tried to update

$ ytdl -U
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--proxy', u'http://127.0.0.1:8087/', u'--socket-timeout', u'1200', u'--yes-playlist', u'-o', u'%(playlist_index)s.%(ext)s', u'--user-agent', u'Mozilla/5.0 (Windows NT 6.0; rv:46.0) Gecko/20100101 Firefox/46.0', u'--write-auto-sub', u'--sub-format', u'"srt/best"', u'--embed-subs', u'-f', u'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best', u'--recode-video', u'mp4', u'--no-post-overwrites', u'-k', u'-U']
[debug] Encodings: locale cp936, fs mbcs, out None, pref cp936
[debug] youtube-dl version 2016.05.30.2
[debug] Python version 2.7.12 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-80123-gd74cc61, ffprobe N-80123-gd74cc61
[debug] Proxy map: {u'http': u'http://127.0.0.1:8087/', u'https': u'http://127.0.0.1:8087/'}
Traceback (most recent call last):
  File "..\ytdl.py\youtube_dl\update.py", line 45, in update_self
    newversion = opener.open(VERSION_URL).read().decode('utf-8').strip()
  File "D:\Program Files\Python27\lib\urllib2.py", line 429, in open
    response = self._open(req, data)
  File "D:\Program Files\Python27\lib\urllib2.py", line 447, in _open
    '_open', req)
  File "D:\Program Files\Python27\lib\urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "..\ytdl.py\youtube_dl\utils.py", line 939, in https_open
    req, **kwargs)
  File "D:\Program Files\Python27\lib\urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

ERROR: can't find the current version. Please try again later.

though i fixed it with --no-check-certificate, i still wonder why it failed

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 11, 2016

I guess you are using XX-Net? This software uses its own self-issued certificate, so --no-check-certificate is necessary.

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