я получил список с именем href_w с кучей mp3 ссылки для загрузки, но когда я исполню этот кусок кода, он дает мне ошибку:Mp3 скачать urllib.request.urlopen() Тайм-аут
# Download file
print(color.BLUE + "\n[*] Downloading requested mp3(s) ..." + color.END)
for link in href_w:
url = "http://www.mp3c.cc"+link.replace('track','files')
print("[*] GET "+url)
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
response = urlopen(req)
html = response.read()
журнал ошибок выглядит следующим образом:
[*] Downloading requested mp3(s) ...
[*] GET http://www.mp3c.cc/files/88144527_288384031/
Traceback (most recent call last):
File "mp3spyder.py", line 99, in <module>
response = urlopen(req)
File "/usr/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.4/urllib/request.py", line 493, in error
result = self._call_chain(*args)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/usr/lib/python3.4/urllib/request.py", line 676, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.4/urllib/request.py", line 499, in error
return self._call_chain(*args)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway
Что я могу сделать, чтобы сделать это правильно?