Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
Added Headers to fix issue AliFlux#7 .
  • Loading branch information
ethosgr authored Dec 15, 2020
1 parent 9c2d9ac commit 2803311
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ def downloadFile(url, destination, x, y, z):
ssl._create_default_https_context = ssl._create_unverified_context

try:
opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib.request.install_opener(opener)
path, response = urllib.request.urlretrieve(url, destination)
code = 200
except urllib.error.URLError as e:
Expand Down

0 comments on commit 2803311

Please sign in to comment.