mirror of
https://github.com/ModOrganizer2/modorganizer-umbrella.git
synced 2026-07-27 13:58:32 -07:00
403 Forbidden fix
This commit is contained in:
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user