Add proxy arg to get for downloading files

This commit is contained in:
ammar
2021-12-03 16:42:52 -08:00
parent 5f3b6f9a5b
commit 936c43b6fa

View File

@@ -124,7 +124,7 @@ class APIHandler(AlarmAPIMixin,
tgt_filepath = data[0].pop('filepath') tgt_filepath = data[0].pop('filepath')
# Apply the data to the params # Apply the data to the params
params.update(data[0]) params.update(data[0])
with requests.get(self.url, params=params, stream=True, verify=False, timeout=(1, None)) as req: with requests.get(self.url, params=params, stream=True, verify=False, timeout=(1, None), proxies=Request.proxies) as req:
if req.status_code == 200: if req.status_code == 200:
with open(tgt_filepath, 'wb') as f: with open(tgt_filepath, 'wb') as f:
f.write(req.content) f.write(req.content)