From ed16b76cda04ad33eded0896305afa4c277dff8e Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 18 Feb 2021 22:53:51 +1100 Subject: [PATCH] Fix HTTPS video download Adding missing `verify=False` parameter to fix the error: `(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:1124)')))` Also, I would suggest using HTTPS by default, otherwise you are leaking the username and password to everyone on the network. --- 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 46d4637..0b8abab 100644 --- a/reolinkapi/handlers/api_handler.py +++ b/reolinkapi/handlers/api_handler.py @@ -124,7 +124,7 @@ class APIHandler(AlarmAPIMixin, 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) as req: + with requests.get(self.url, params=params, stream=True, verify=False, timeout=(1, None)) as req: if req.status_code == 200: with open(tgt_filepath, 'wb') as f: f.write(req.content)