From 936c43b6fa94a03fdf978ee78b961b629cc7d7e9 Mon Sep 17 00:00:00 2001 From: ammar Date: Fri, 3 Dec 2021 16:42:52 -0800 Subject: [PATCH] Add proxy arg to get for downloading files --- reolinkapi/handlers/api_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reolinkapi/handlers/api_handler.py b/reolinkapi/handlers/api_handler.py index 0b8abab..501ceb7 100644 --- a/reolinkapi/handlers/api_handler.py +++ b/reolinkapi/handlers/api_handler.py @@ -124,7 +124,7 @@ def _execute_command(self, command: str, data: List[Dict], multi: bool = False) tgt_filepath = data[0].pop('filepath') # Apply the data to the params 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: with open(tgt_filepath, 'wb') as f: f.write(req.content)