Open Brey86 opened 2 years ago
Uninstall sseclient-py==1.7.2
I have uninstalled sseclient-py
pip uninstall sseclient-py
Found existing installation: sseclient-py 1.7.2
Uninstalling sseclient-py-1.7.2:
Would remove:
/usr/lib/python3.8/site-packages/sseclient/*
/usr/lib/python3.8/site-packages/sseclient_py-1.7.2.dist-info/*
Proceed (Y/n)? Y
Successfully uninstalled sseclient-py-1.7.2
But I have the same output:
arlo = Arlo(USERNAME_arlo, PASSWORD_arlo)
File "/usr/lib/python3.8/site-packages/arlo.py", line 71, in __init__
self.Login(username, password)
File "/usr/lib/python3.8/site-packages/arlo.py", line 144, in Login
self.request.options(f'https://{self.AUTH_URL}/api/auth', headers=headers)
File "/usr/lib/python3.8/site-packages/request.py", line 83, in options
return self._request(url, 'OPTIONS', headers=headers, raw=raw)
File "/usr/lib/python3.8/site-packages/request.py", line 59, in _request
r.raise_for_status()
File "/usr/lib/python3.8/site-packages/requests/models.py", line 953, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://ocapi-app.arlo.com/api/auth
if I try to access the URL directly (https://ocapi-app.arlo.com/api/auth) It shows me an error 1020. (Access Denied)
@Brey86 try now with the latest release.
Thanks for the new version.
I have upgraded my version and now I can login, but I can't disarm de alarm.
This is mi simple code:
arlo = Arlo(USERNAME_arlo, PASSWORD_arlo)
basestations = arlo.GetDevices('basestation')
arlo.Disarm(basestations[0])
This code was working fine until Friday. Now, with the new version, when I call the Disarm function the program crashes:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/eventstream.py", line 75, in Start
event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+self.arlo.request.session.headers.get('Authorization').decode(), session=self.arlo.request.session)
AttributeError: 'str' object has no attribute 'decode'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "AlarmaOFF.py", line 49, in <module>
arlo.Disarm(basestations[0])
File "/usr/lib/python3.8/site-packages/arlo.py", line 569, in Disarm
return self.CustomMode(device, "mode0")
File "/usr/lib/python3.8/site-packages/arlo.py", line 561, in CustomMode
return self.NotifyAndGetResponse(device, {"from":self.user_id+"_web", "to": device.get("parentId"), "action":"set","resource":"modes", "transId": self.genTransId(),"publishResponse":True,"properties":{"active":mode}})
File "/usr/lib/python3.8/site-packages/arlo.py", line 407, in NotifyAndGetResponse
self.Subscribe(basestation)
File "/usr/lib/python3.8/site-packages/arlo.py", line 340, in Subscribe
self.event_stream.Start()
File "/usr/lib/python3.8/site-packages/eventstream.py", line 80, in Start
raise Exception('Failed to start eventstream thread: {0}'.format(e))
Exception: Failed to start eventstream thread: 'str' object has no attribute 'decode'
Exception ignored in: <function EventStream.__del__ at 0x7fd6091b0ca0>
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/eventstream.py", line 42, in __del__
File "/usr/lib/python3.8/site-packages/eventstream.py", line 90, in Disconnect
File "/usr/lib/python3.8/site-packages/eventstream.py", line 110, in Unregister
AttributeError: 'EventStream' object has no attribute 'event_stream_thread'
Unfortunately, I no longer have any Arlo devices to debug with... Can you clone this repository and run add this line print(self.arlo.request.session.headers.get('Authorization'))
at eventstream.py on line 75 just above event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+self.arlo.request.session.headers.get('Authorization').decode(), session=self. arlo.request.session)
?
Seems like the auth header is either empty or already a string.
It actually looks like they Arlo devs moved away from EventStream to mqtt. If I'm reading that correctly, that's going to take a considerable amount of work to rewrite. 😢
This is the output of:
print(self.arlo.request.session.headers.get('Authorization'))
2_ofCKwDvvbStdq3tgyA................................................................................
For security reasons I censured a part of string was printed.
This is somewhat off-topic, but it might be helpful to some: After using Jeffrey's wonderful library for six years (since 2016), it all came to an end when Arlo finally forced 2FA on me. Since my application is simple -- arming and disarming my cameras from a Raspberry Pi based on a contact closure from our ancient security systems -- I switched to using IFTTT (https://ifttt.com). They have an officially-sanctioned link to Arlo as a third-party service, so arming/disarming is simple: just send an HTTPS post request to IFTTT. But they have only a few other functions available (lights on/off, start recording, and sound siren), so it won't work for more sophisticated applications.
2FA is accounted for in the latest version .. much notes about it https://github.com/jeffreydwalter/arlo#now-supports-mfa https://github.com/jeffreydwalter/arlo/issues/183
I know, I had seen that. But using IFTTT is (a) much less complicated, (b) lightening-fast, and (c) doesn't involve gmail, which I'm not a fan of. Not for everyone, I know...
(c) doesn't involve gmail, which I'm not a fan of.
On this, I made a pull request for interactive login that doesn't scrape your gmail. You can choose any of your saved approved devices. (An approved cellphone arlo app will get a login notification request or another gmail including non-gmail)
But seeing that arlo moved to mqtt, it's all kina moot. 😭
I'm working on getting mqtt working. I just don't have any Arlo cameras anymore, so I'm going to bed volunteers to help me test.
Id gladly send you a camera for your continued support
I'm working on getting mqtt working. I just don't have any Arlo cameras anymore, so I'm going to bed volunteers to help me test.
I can help you to test what you need.
Any news about this?
Still working on it. Didn't have much time this past week.
Any news about this?
Thanks for your work!
This seems like an awesome library but I'm also stuck here trying to connect to the Arlo system (just running
arlo = Arlo(USERNAME, PASSWORD) basestations = arlo.GetDevices('basestation')
creates the issue for me) Is anyone working on the issue or where can I start looking in order to help out and contribute?
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using (
python -V
)?Python 3.8.8
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.uname());'
)?uname_result(system='Linux', node='Nas', release='4.4.180+', version='#42218 SMP Mon Oct 18 19:16:55 CST 2021', machine='x86_64', processor='')
Which Python packages do you have installed (run the
pip freeze
orpip3 freeze
command and paste output)?Which version of ffmpeg are you using (
ffmpeg -version
)?Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?
Arlo Essential Spotlight
What did you do?
To reproduce the error it is only necessary to try to login:
What did you expect to see?
What did you see instead?
Does this issue reproduce with the latest release?
Yes.