diff --git a/changelog b/changelog index 8702dee..1e1bd0c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +0.8.0.0 + Try multiple EDHC curves + Allow `Source: arloWebCam` header entry to be turned on and off + 0.8.0b12: Add Arlo Pro 5 support Allow cloudflare curves to be set diff --git a/pyaarlo/__init__.py b/pyaarlo/__init__.py index d9847f8..e866a43 100644 --- a/pyaarlo/__init__.py +++ b/pyaarlo/__init__.py @@ -46,7 +46,7 @@ _LOGGER = logging.getLogger("pyaarlo") -__version__ = "0.8.0b12" +__version__ = "0.8.0.0" class PyArlo(object): @@ -132,6 +132,7 @@ class PyArlo(object): * **mqtt_transport** - specify either `websockets` or `tcp`, default `tcp` * **ecdh_curve** - Sets initial ecdhCurve for Cloudscraper. Available options are `prime256v1` and `secp384r1`. Backend will try all options if login fails. + * **send_source** - Add a `Source` item to the authentication header, default is False. **Attributes** diff --git a/pyaarlo/backend.py b/pyaarlo/backend.py index 32822b2..a657ed5 100644 --- a/pyaarlo/backend.py +++ b/pyaarlo/backend.py @@ -674,7 +674,7 @@ def _update_auth_info(self, body): self._expires_in = body["expiresIn"] def _auth_headers(self): - return { + headers = { "Accept": "application/json, text/plain, */*", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "en-GB,en;q=0.9,en-US;q=0.8", @@ -688,13 +688,20 @@ def _auth_headers(self): # "Sec-Fetch-Dest": "empty", # "Sec-Fetch-Mode": "cors", # "Sec-Fetch-Site": "same-site", - # "Source": "arloCamWeb", "User-Agent": self._user_agent, "X-User-Device-Automation-name": "QlJPV1NFUg==", "X-User-Device-Id": self._user_device_id, "X-User-Device-Type": "BROWSER", } + # Add Source if asked for. + if self._arlo.cfg.send_source: + headers.update({ + "Source": "arloCamWeb", + }) + + return headers + def _headers(self): return { "Accept": "application/json", diff --git a/pyaarlo/cfg.py b/pyaarlo/cfg.py index e07267a..cdcc9dd 100644 --- a/pyaarlo/cfg.py +++ b/pyaarlo/cfg.py @@ -295,3 +295,7 @@ def ecdh_curves(self): # Moves user-selected curve to front of list ECDH_CURVES.insert(0, ECDH_CURVES.pop(ECDH_CURVES.index(curve))) return ECDH_CURVES + + @property + def send_source(self): + return self._kw.get("send_source", False) diff --git a/setup.py b/setup.py index 6a79d3b..1f6c9f7 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def readme(): setup( name='pyaarlo', - version='0.8.0b12', + version='0.8.0.0', packages=['pyaarlo'], python_requires='>=3.7',