Skip to content

Commit a6a1e0c

Browse files
authored
Merge pull request #279 from SmartAPI/fix-downloader-missing-header
Fix downloader missing header.
2 parents 32027a1 + 18c5816 commit a6a1e0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/downloader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ async def download_async(url, timeout=20, raise_error=True):
151151

152152

153153
def download_mapping(url):
154-
response = requests.get(url)
154+
headers = {
155+
'User-Agent': 'SmartAPI'
156+
}
157+
response = requests.get(url, headers=headers, timeout=60)
155158
response.raise_for_status()
156159

157160
return decoder.to_dict(stream=response.content, ext=file_extension(url), ctype=response.headers.get("Content-Type"))

0 commit comments

Comments
 (0)