We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 14051b7 + 57c868e commit 9ae5d7dCopy full SHA for 9ae5d7d
ee/core/download.py
@@ -22,7 +22,9 @@ def download(self, packages):
22
if not os.path.exists(directory):
23
os.makedirs(directory)
24
Log.info(self, "Downloading {0:20}".format(pkg_name), end=' ')
25
- urllib.request.urlretrieve(url, filename)
+ req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
26
+ with urllib.request.urlopen(req) as response, open(filename, 'wb') as out_file:
27
+ out_file.write(response.read())
28
Log.info(self, "{0}".format("[" + Log.ENDC + "Done"
29
+ Log.OKBLUE + "]"))
30
except urllib.error.URLError as e:
0 commit comments