Skip to content

Commit

Permalink
Add option for ecdh curve and backup at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
tyr84 committed Oct 11, 2023
1 parent 7cb241c commit 87e535c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ MQTT_TOPIC_MOTION: motion events will be published to this topic. (default: arlo
MQTT_RECONNECT_INTERVAL: Wait this amount before retrying connection to broker (in seconds) (default: 5)
STATUS_INTERVAL: Time between published status messages (in seconds) (default: 120)
DEBUG: True enables full debug (default: False)
PYAARLO_ECDH_CURVE: ecdh Curve used to bypass Cloudflare. (default determined by cloudscraper). Try `secp384r1` if struggling with login.
PYAARLO_BACKEND: Pyaarlo backend. (default determined by pyaarlo). Options are `mqtt` and `sse`.
```
### Running
```
Expand Down
24 changes: 19 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
MOTION_TIMEOUT = config('MOTION_TIMEOUT', default=60, cast=int)
STATUS_INTERVAL = config('STATUS_INTERVAL', default=120, cast=int)
DEBUG = config('DEBUG', default=False, cast=bool)
PYAARLO_ECDH_CURVE=config('PYAARLO_ECDH_CURVE', default=None)
PYAARLO_BACKEND=config('PYAARLO_BACKEND', default=None)

# Initialize logging
logging.basicConfig(
Expand All @@ -28,11 +30,23 @@

async def main():
# login to arlo with 2FA
arlo = pyaarlo.PyArlo(
username=ARLO_USER, password=ARLO_PASS,
tfa_source='imap', tfa_type='email', tfa_host=IMAP_HOST,
tfa_username=IMAP_USER, tfa_password=IMAP_PASS, backend='sse'
)
arlo_args = {
'username': ARLO_USER,
'password': ARLO_PASS,
'tfa_source': 'imap',
'tfa_type': 'email',
'tfa_host': IMAP_HOST,
'tfa_username': IMAP_USER,
'tfa_password': IMAP_PASS
}

if PYAARLO_ECDH_CURVE:
arlo_args['ecdh_curve'] = PYAARLO_ECDH_CURVE

if PYAARLO_BACKEND:
arlo_args['backend'] = PYAARLO_BACKEND

arlo = pyaarlo.PyArlo(**arlo_args)

# Initialize and start cameras
cameras = [Camera(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git+https://github.com/twrecked/pyaarlo
git+https://github.com/tyr84/pyaarlo@ecdh_curve
python-decouple
asyncio-mqtt
aiostream

0 comments on commit 87e535c

Please sign in to comment.