403 Forbidden fix

This commit is contained in:
cibrhusk
2020-05-31 11:03:36 -07:00
committed by Chris Bessent
parent 92a6039d84
commit 4d89e7850e
+3 -1
View File
@@ -25,7 +25,9 @@ def download(url, filename):
if os.path.exists(filename):
return False
data = urllib.request.urlopen(url)
user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'
req = urllib.request.Request(url, headers={'User-Agent' : user_agent})
data = urllib.request.urlopen(req)
with open(filename, 'wb') as outfile:
while True:
block = data.read(4096)