creotiv / deezer_playlist_mp3_downloader

Download MP3 from Deezer playlist
GNU General Public License v3.0
46 stars 12 forks source link

Socket error #6

Closed ingjemch closed 5 years ago

ingjemch commented 6 years ago

I have tried to use the script and getting the following error:

Traceback (most recent call last): File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connection.py", line 141, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\util\connection.py", line 60, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 600, in urlopen chunked=chunked) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 345, in _make_request self._validate_conn(conn) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 844, in _validate_conn conn.connect() File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connection.py", line 284, in connect conn = self._new_conn() File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connection.py", line 150, in _new_conn self, "Failed to establish a new connection: %s" % e) requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04F622F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\adapters.py", line 423, in send timeout=timeout File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 649, in urlopen _stacktrace=sys.exc_info()[2]) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\packages\urllib3\util\retry.py", line 376, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.deezer.com%5calbum%5c42014431', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04F622F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Jorge\AppData\Local\Programs\Python\Python37-32\Scripts\dzget-script.py", line 11, in load_entry_point('Deezer-MP3-Downloader==0.0.6', 'console_scripts', 'dzget')() File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\deezermp3\dzget.py", line 127, in main dmp3.download_playlist(url) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\deezermp3\dzget.py", line 49, in download_playlist res = requests.get(url) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\api.py", line 70, in get return request('get', url, params=params, kwargs) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\api.py", line 56, in request return session.request(method=method, url=url, kwargs) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\sessions.py", line 488, in request resp = self.send(prep, send_kwargs) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\sessions.py", line 609, in send r = adapter.send(request, kwargs) File "c:\users\jorge\appdata\local\programs\python\python37-32\lib\site-packages\requests\adapters.py", line 487, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.deezer.com%5calbum%5c42014431', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04F622F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

DiegoGR97 commented 6 years ago

I had the same issue. I definitely don't understand the code so I'll have to wait for a fix from the repository owner. Hope he gets it right because the project looks good and it's ambitious!

creotiv commented 6 years ago

This problem because host cant be resolved. its problem with your network provider or proxy that u are using on your system.

zelezni commented 6 years ago

I'm on Windows 10 and have exactly the same problem. It is caused by line 48: url = os.path.join(API_URL, list_type, playlist_id)

because url translates to api.deezer.com%5cplaylist%5cSOME_NUMBER

%5c is code for backslash ("\"), but there should be a normal slash ("/").

Quick and dirty workaround (Python 3.7) is to change that line to: url = f'{API_URL}/{list_type}/{playlist_id}'