python-arlo icon indicating copy to clipboard operation
python-arlo copied to clipboard

PyAlro login issue

Open itskvad opened this issue 4 years ago • 20 comments

Hi,

I have PyArlo run every 30 mins to check my Arlo base station using AzureDevOps pipelines.

Running PyArlo('username', 'passwordhere') is now giving the following error:

PyArlo('username', 'passwordhere') Traceback (most recent call last): File "", line 1, in File "C:\Python38\lib\site-packages\pyarlo_init_.py", line 50, in init self.ArloMediaLibrary = ArloMediaLibrary(self, File "C:\Python38\lib\site-packages\pyarlo\media.py", line 29, in init self.videos = self.load(days) File "C:\Python38\lib\site-packages\pyarlo\media.py", line 56, in load data = self._session.query(url, AttributeError: 'NoneType' object has no attribute 'get'

This error is also occurring manually on execution.

Can you advise on how I can assist with getting this resolved? Thanks.

itskvad avatar Mar 21 '20 02:03 itskvad

Seeing this issue as well.

thejeffreystone avatar Mar 21 '20 02:03 thejeffreystone

Seeing the same issue. Seems Arlo has changed the api :-(

mberry73 avatar Mar 21 '20 12:03 mberry73

I'm having the same problem. In my case this query to "arlo.netgear.com/hmsweb/users/library" failed due to 401. But even before that, _authenticate() already failed silently where the query to "arlo.netgear.com/hmsweb/login/v2" failed due to 403.

yoooou avatar Mar 21 '20 18:03 yoooou

same here

Zaschii avatar Mar 21 '20 20:03 Zaschii

Same for me... Help please...

vzlgdu avatar Mar 22 '20 07:03 vzlgdu

I have a PR #115 which works for me. My tests are very limited though. Thanks @thejeffreystone for the pointer.

yoooou avatar Mar 22 '20 21:03 yoooou

Sorry, but I don't understand what is the solution that works for you! Please can you explain better? Thanks

vzlgdu avatar Mar 22 '20 21:03 vzlgdu

I don't really know what happened under the hood. I'm just following what this PR did. I guess we need to use a new authentication mechanism to login now so some code changes to API endpoints and requests/responses are required - see the PR for details.

yoooou avatar Mar 22 '20 22:03 yoooou

yes its working with the new authentication mechanism. it seems that its a little bit slower, but thats not a problem for me... thank you very much. Just changed the 2 files const.py and __init__py.

Zaschii avatar Mar 22 '20 22:03 Zaschii

Not to take away from the great work that has been done within this repo (I've even made small contributions once upon a time), but it has not been actively supported for a while and I keep seeing the notifications for issues and feature requests. I just wanted to share that there are other repos that are currently active and adjusting to these changes. Twrecked is managing this repo, along with plugin repos for Home Assistant, and they work very well: https://github.com/twrecked/pyaarlo

jwillaz avatar Mar 23 '20 06:03 jwillaz

Thanks for fixing it guys. Will give it a try asap. jwillaz, I had a short look into pyaarlo. A little documentation would certainly help to get people interested i guess. :-)

mberry73 avatar Mar 23 '20 10:03 mberry73

Hi, sorry, but I don't understand what are you done to fix this; I've uninstalled and reinstalled pyarlo, but the problem is the same. Please could you explain me step by step what should I do to solve? Thanks

vzlgdu avatar Mar 23 '20 13:03 vzlgdu

@mberry73 you'll be able to find examples of leveraging the base package through the Home Assistant component, which has a lot of documentation, tips, and observations about the API: https://github.com/twrecked/hass-aarlo

jwillaz avatar Mar 23 '20 16:03 jwillaz

Hi, I’m testing your exemple; my scope is selecta base and check what is the active mode…

Do you have some sugget?

Thanks

Il giorno 23 mar 2020, alle ore 17:43, Jeremy Williams [email protected] ha scritto:

@mberry73 https://github.com/mberry73 you'll be able to find examples of leveraging the base package through the Home Assistant component, which has a lot of documentation, tips, and observations about the API: https://github.com/twrecked/hass-aarlo https://github.com/twrecked/hass-aarlo — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tchellomello/python-arlo/issues/114#issuecomment-602718966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHUN66MK2UXLPSWRQEYD4XTRI6GRTANCNFSM4LQYFNKA.

vzlgdu avatar Mar 23 '20 18:03 vzlgdu

Using https://github.com/twrecked/pyaarlo/ now.

itskvad avatar Mar 27 '20 04:03 itskvad

So this works? Is the install the same for a Hassio version of HA?

madhatter007 avatar Mar 28 '20 01:03 madhatter007

Not quite sure what you mean. I'm just using the python module with my own scripts.

pip install git+https://github.com/twrecked/pyaarlo import pyaarlo

itskvad avatar Mar 29 '20 22:03 itskvad

Being non-technical, I followed the below getting setup at install. https://www.home-assistant.io/integrations/arlo/

So can drop this update above on my HA install, config, and should be good getting Arlo going again?

madhatter007 avatar Apr 01 '20 13:04 madhatter007

https://github.com/tchellomello/python-arlo/pull/115 LGTM and I verified it fixes the issue -- can we just merge that in?

fermulator avatar Aug 23 '20 12:08 fermulator

Seems like the issue is that the login API is now blocking requests where user agent is python-requests or more specifically ('User-Agent', 'python-requests/2.24.0') which is the default. The 1 line fix is to add something like:

headers['User-Agent'] = 'foobar'

right before this line.

zuyezheng avatar Aug 28 '20 03:08 zuyezheng