glomatico / gamdl

A Python CLI app for downloading Apple Music songs/music videos/posts.
MIT License
811 stars 93 forks source link

Failed to download #135

Closed Young-ML closed 3 months ago

Young-ML commented 3 months ago

originally I typed gamdl "https://music.apple.com/cn/album/%E5%82%AC%E7%9C%A0/966481932?i=966481936&l=en-GB"
it prompted [INFO 23:19:50] (URL 1/1) Checking "https://music.apple.com/cn/album/%E5%82%AC%E7%9C%A0/966481932?i=966481936&l=en-GB" [INFO 23:19:51] (Track 1/1 from URL 1/1) Downloading "催眠" [ERROR 23:19:56] (Track 1/1 from URL 1/1) Failed to download "催眠" [INFO 23:19:56] Done (1 error(s))

instead, I typed the same command but with --print-exceptions(as is suggested in #101) gamdl "https://music.apple.com/cn/album/%E5%82%AC%E7%9C%A0/966481932?i=966481936&l=en-GB" --print-exceptions still no use, it prompted [INFO 23:20:03] (URL 1/1) Checking "https://music.apple.com/cn/album/%E5%82%AC%E7%9C%A0/966481932?i=966481936&l=en-GB" [INFO 23:20:06] (Track 1/1 from URL 1/1) Downloading "催眠" [ERROR 23:20:08] (Track 1/1 from URL 1/1) Failed to download "催眠" Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1344, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1336, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1382, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1331, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1091, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1035, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1477, in connect self.sock = self._context.wrap_socket(self.sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 455, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1042, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1320, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/gamdl/cli.py", line 540, in main stream_info = downloader_song_legacy.get_stream_info( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/gamdl/downloader_song_legacy.py", line 26, in get_stream_info m3u8_obj = m3u8.load(stream_info.stream_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/m3u8/init.py", line 94, in load content, base_uri = http_client.download(uri, timeout, headers, verify_ssl) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/m3u8/httpclient.py", line 16, in download resource = opener.open(uri, timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 515, in open response = self._open(req, data) ^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 532, in _open result = self._call_chain(self.handle_open, protocol, protocol + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 492, in _call_chain result = func(*args) ^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1392, in https_open return self.do_open(http.client.HTTPSConnection, req, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1347, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)> [INFO 23:20:08] Done (1 error(s))

it drove me crazy :( please help me !

glomatico commented 3 months ago

https://stackoverflow.com/questions/42098126/mac-osx-python-ssl-sslerror-ssl-certificate-verify-failed-certificate-verify

Young-ML commented 3 months ago

https://stackoverflow.com/questions/42098126/mac-osx-python-ssl-sslerror-ssl-certificate-verify-failed-certificate-verify

thanks! it worked!