Closed anarcat closed 9 years ago
I'll just mention that I can't reproduce it here, so I won't be able to help. "toutv fetch Infoman S15E16" downloads fine. I checked with strace like you do, it indeed downloads from HTTPS (https://toutvuniver1-vh.akamaihd.net/...).
i can confirm this is a problem with the "requests" package, at least in Debian Jessie:
ii python3-requests 2.4.3-4 all elegant and simple HTTP library for Python3, built f
ii python3 3.4.2-2 amd64 interactive high-level object-oriented language (def
$ python3 -c "import requests; r=requests.get('https://toutvuniver1-vh.akamaihd.net/i/012/mp4/i/2014-12-31_22_00_00_infoman_0385_,400,500,800,1200,.mp4.csmil/master.m3u8?hdnea=st=1420516862~exp=1420516877~acl=/i/012/mp4/i/2014-12-31_22_00_00_infoman_0385_*~hmac=b7beecbc39e2c89fc033f8946e74d0771adb92acbbe36d75332ace8c4722d5ed'); print(r.status_code)"
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 516, in urlopen
body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 304, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 724, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 237, in connect
ssl_version=resolved_ssl_version)
File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 123, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_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 "/usr/lib/python3/dist-packages/requests/adapters.py", line 362, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 543, in urlopen
raise SSLError(e)
urllib3.exceptions.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 "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in get
return request('get', url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 49, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 457, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 569, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 420, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
the server's HTTPS configuration is less than desirable but that shouldn't stop us from downloading funny videos. :)
oh wow, totally weird: it turns out i had one certificate disabled in the ca-certificates
package, and that turns out to be the one used by akamai. bloody hell... sorry for the noise, dpkg-reconfigure ca-certificates
fixed it. :)
Phew!
there seems to be certain videos that fail to download because of problems with HTTPS:
wget seems to be able to get the file correctly, however:
Now, interestingly, other episodes seem to download fine:
... this one is not served from an HTTPS url!
so i am guessing the HTTPS validation methods are failing here.