@@ -252,6 +252,11 @@ def LoginMFA(self, username, password, google_credential_file):
252
252
code = search .group (0 )
253
253
break
254
254
255
+ """
256
+ code = input("Enter MFA code:\n ")
257
+ print("CODE", factor_auth_code)
258
+ """
259
+
255
260
# Complete auth
256
261
finish_auth_body = self .request .post (
257
262
f'https://{ self .AUTH_URL } /api/finishAuth' ,
@@ -264,7 +269,12 @@ def LoginMFA(self, username, password, google_credential_file):
264
269
)
265
270
266
271
# Update Authorization code with new code
267
- self .request .session .headers .update ({'Authorization' : base64 .b64encode (finish_auth_body ['data' ]['token' ].encode ('utf-8' ))})
272
+ headers = {
273
+ 'Auth-Version' : '2' ,
274
+ 'Authorization' : finish_auth_body ['data' ]['token' ].encode ('utf-8' ),
275
+ 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)' ,
276
+ }
277
+ self .request .session .headers .update (headers )
268
278
self .BASE_URL = 'myapi.arlo.com'
269
279
270
280
def Logout (self ):
@@ -974,6 +984,26 @@ def GetSession(self):
974
984
"""
975
985
return self .request .get (f'https://{ self .BASE_URL } /hmsweb/users/session' )
976
986
987
+ def GetSessionV2 (self ):
988
+ """
989
+ Returns something like the following:
990
+ {
991
+ "userId": "XXX-XXXXXXX",
992
+
993
+ "token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
994
+ "paymentId": "XXXXXXXX",
995
+ "accountStatus": "registered",
996
+ "serialNumber": "XXXXXXXXXXXXXX",
997
+ "countryCode": "US",
998
+ "tocUpdate": false,
999
+ "policyUpdate": false,
1000
+ "validEmail": true,
1001
+ "arlo": true,
1002
+ "dateCreated": 1463975008658
1003
+ }
1004
+ """
1005
+ return self .request .get (f'https://{ self .BASE_URL } /hmsweb/users/session/v2' )
1006
+
977
1007
def GetFriends (self ):
978
1008
return self .request .get (f'https://{ self .BASE_URL } /hmsweb/users/friends' )
979
1009
0 commit comments