Есть def:
def download(url, filename):
urllib.request.urlretrieve(url, filename)
если направить ссыль допустим
easylink.cf/sign/minecraft/minecraft.php?text=test...
то все норм скачает , если :
https://translate.google.com/translate_tts?ie=UTF-...
то ошибка:
Traceback (most recent call last):
File "C:\Users\nikit\Desktop\FoxyVKBOT\upload.py", line 24, in
print(download(url,'test.jpg'))
File "C:\Users\nikit\Desktop\FoxyVKBOT\upload.py", line 21, in download
urllib.request.urlretrieve(url, filename)
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 188, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 472, in open
response = meth(req, response)
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 510, in error
return self._call_chain(*args)
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 444, in _call_chain
result = func(*args)
File "C:\Users\nikit\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden