Skip to content

Commit

Permalink
Make source optional (#137)
Browse files Browse the repository at this point in the history
* Fixed scheme support.

* Fixed scheme support.
  • Loading branch information
twrecked authored Oct 31, 2023
1 parent 6d0d7a4 commit b86bd22
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyaarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

_LOGGER = logging.getLogger("pyaarlo")

__version__ = "0.8.0b12"
__version__ = "0.8.0.0"


class PyArlo(object):
Expand Down Expand Up @@ -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**
Expand Down
11 changes: 9 additions & 2 deletions pyaarlo/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions pyaarlo/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def readme():
setup(

name='pyaarlo',
version='0.8.0b12',
version='0.8.0.0',
packages=['pyaarlo'],

python_requires='>=3.7',
Expand Down

0 comments on commit b86bd22

Please sign in to comment.