mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
49_Arlo.py: fixed login problems
git-svn-id: https://svn.fhem.de/fhem/trunk@28380 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4f9812fd1a
commit
b6bb3bac7d
@ -5,6 +5,7 @@ import cloudscraper
|
|||||||
import email
|
import email
|
||||||
import imaplib
|
import imaplib
|
||||||
import re
|
import re
|
||||||
|
import uuid;
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
|
|
||||||
class Arlo:
|
class Arlo:
|
||||||
@ -28,17 +29,21 @@ class Arlo:
|
|||||||
}
|
}
|
||||||
self._session.options(self._baseUrl + "auth", headers=self._headers)
|
self._session.options(self._baseUrl + "auth", headers=self._headers)
|
||||||
|
|
||||||
|
self._user_device_id = str(uuid.uuid4())
|
||||||
self._headers = {
|
self._headers = {
|
||||||
|
"Accept": "application/json, text/plain, */*",
|
||||||
"DNT": "1",
|
"DNT": "1",
|
||||||
"schemaVersion": "1",
|
"schemaVersion": "1",
|
||||||
"Auth-Version": "2",
|
"Auth-Version": "2",
|
||||||
"Cache-Control": "no-cache",
|
"Cache-Control": "no-cache",
|
||||||
"Content-Type": "application/json; charset=UTF-8",
|
"Content-Type": "application/json; charset=UTF-8",
|
||||||
"Origin": "https://my.arlo.com",
|
"Origin": "https://my.arlo.com",
|
||||||
"Pragma": "no-cache",
|
|
||||||
"Referer": "https://my.arlo.com/",
|
"Referer": "https://my.arlo.com/",
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.58',
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.58',
|
||||||
"Source": "arloCamWeb"
|
"Source": "arloCamWeb",
|
||||||
|
"X-User-Device-Automation-name": "QlJPV1NFUg==",
|
||||||
|
"X-User-Device-Id": self._user_device_id,
|
||||||
|
"X-User-Device-Type": "BROWSER",
|
||||||
}
|
}
|
||||||
self._token = None
|
self._token = None
|
||||||
|
|
||||||
@ -58,6 +63,9 @@ class Arlo:
|
|||||||
if r.status_code == 400:
|
if r.status_code == 400:
|
||||||
error("Bad auth request - probably the credentials are wrong.")
|
error("Bad auth request - probably the credentials are wrong.")
|
||||||
return
|
return
|
||||||
|
if r.status_code == 403:
|
||||||
|
error("Unauthorized - probably the credentials are wrong.")
|
||||||
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log(e)
|
log(e)
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user