From 2803311f9dfca26670bceae21afc76311e6b69da Mon Sep 17 00:00:00 2001 From: ethosgr <58391770+ethosgr@users.noreply.github.com> Date: Tue, 15 Dec 2020 20:13:03 +0200 Subject: [PATCH] Update utils.py Added Headers to fix issue #7 . --- src/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.py b/src/utils.py index a575b3e..d6d2bd6 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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: