|
@@ -30,6 +30,7 @@ from mauigpapi.errors import (
|
|
IGLoginTwoFactorRequiredError,
|
|
IGLoginTwoFactorRequiredError,
|
|
)
|
|
)
|
|
from mauigpapi.http import AndroidAPI
|
|
from mauigpapi.http import AndroidAPI
|
|
|
|
+from mauigpapi.proxy import proxy_with_retry
|
|
from mauigpapi.state import AndroidState
|
|
from mauigpapi.state import AndroidState
|
|
from mauigpapi.types import BaseResponseUser
|
|
from mauigpapi.types import BaseResponseUser
|
|
from mautrix.bridge.commands import HelpSection, command_handler
|
|
from mautrix.bridge.commands import HelpSection, command_handler
|
|
@@ -50,7 +51,12 @@ async def get_login_state(user: u.User, seed: str) -> tuple[AndroidAPI, AndroidS
|
|
seed = hmac.new(seed.encode("utf-8"), user.mxid.encode("utf-8"), hashlib.sha256).digest()
|
|
seed = hmac.new(seed.encode("utf-8"), user.mxid.encode("utf-8"), hashlib.sha256).digest()
|
|
state.device.generate(seed)
|
|
state.device.generate(seed)
|
|
api = AndroidAPI(state, log=user.api_log, proxy_handler=user.proxy_handler)
|
|
api = AndroidAPI(state, log=user.api_log, proxy_handler=user.proxy_handler)
|
|
- await api.get_mobile_config()
|
|
|
|
|
|
+ await proxy_with_retry(
|
|
|
|
+ lambda: api.get_mobile_config(),
|
|
|
|
+ logger=user.log,
|
|
|
|
+ proxy_handler=user.proxy_handler,
|
|
|
|
+ on_proxy_change=user.on_proxy_update,
|
|
|
|
+ )
|
|
user.command_status = {
|
|
user.command_status = {
|
|
"action": "Login",
|
|
"action": "Login",
|
|
"state": state,
|
|
"state": state,
|