Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错有问题 账号和密码都没有错 #3

Open
joe12801 opened this issue Mar 14, 2023 · 6 comments
Open

报错有问题 账号和密码都没有错 #3

joe12801 opened this issue Mar 14, 2023 · 6 comments

Comments

@joe12801
Copy link

File "/root/migpt/MIGPT/miaccount.py", line 74, in login
serviceToken = await self._securityTokenService(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/migpt/MIGPT/miaccount.py", line 114, in _securityTokenService
async with self.session.get(
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 982, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api2.mina.mi.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)')]
Traceback (most recent call last):
File "/root/migpt/MIGPT/MIGPT.py", line 304, in
asyncio.run(miboy.run_forever())
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/root/migpt/MIGPT/MIGPT.py", line 199, in run_forever
await self.init_all_data(session)
File "/root/migpt/MIGPT/MIGPT.py", line 92, in init_all_data
await self._init_data_hardware()
File "/root/migpt/MIGPT/MIGPT.py", line 116, in _init_data_hardware
hardware_data = await self.mina_service.device_list()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/migpt/MIGPT/minaservice.py", line 27, in device_list
result = await self.mina_request("/admin/v2/device_list?master=" + str(master))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/migpt/MIGPT/minaservice.py", line 22, in mina_request
return await self.account.mi_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/migpt/MIGPT/miaccount.py", line 150, in mi_request
raise Exception(f"Error {url}: {resp}")
Exception: Error https://api2.mina.mi.com/admin/v2/device_list?master=0&requestId=app_ios_nuB7SxiGTI2KOsPmdYo4yhpAwQ8HjC: Login failed
root@aml:~/migpt/MIGPT#

@Afool4U
Copy link
Owner

Afool4U commented Mar 15, 2023

这个可能是你本地设置问题?urllib3装指定版本了吗,不能用最新的,然后云服务器也不行

@CrazyBunQnQ
Copy link

我也遇到了,在 IDE 本地执行的
image

@CrazyBunQnQ
Copy link

我也遇到了,在 IDE 本地执行的 image

我的问题解决了,去官网登录时发现有验证,过了验证之后,账号就正常了,目测小米检测刀账号有异常之类的

@renqiang06
Copy link

  • 我也有这个问题:

环境如下:
Package Version
aiohttp 3.8.4
aiosignal 1.3.1
async-timeout 4.0.2
attrs 22.2.0
certifi 2022.12.7
charset-normalizer 3.1.0
frozenlist 1.3.3
idna 3.4
multidict 6.0.4
pip 23.0.1
regex 2022.10.31
requests 2.28.2
setuptools 67.4.0
tiktoken 0.3.2
urllib3 1.25.11
wheel 0.38.4
yarl 1.8.2

报错内容:
正在运行 MiGPT, 请用"打开/关闭高级对话"控制对话模式。 Exception on login *******: ssl should be SSLContext, bool, Fingerprint or None, got False instead.

Error https://api2.mina.mi.com/admin/v2/device_list?master=0&requestId=app_ios_5s0fSJ4RH6hL8AKoqzZcU91yPgTivj: Login failed File "D:\OneDrive\code\michat\miaccount.py", line 150, in mi_request raise Exception(f"Error {url}: {resp}") File "D:\OneDrive\code\michat\minaservice.py", line 22, in mina_request return await self.account.mi_request( File "D:\OneDrive\code\michat\minaservice.py", line 27, in device_list result = await self.mina_request("/admin/v2/device_list?master=" + str(master)) File "D:\OneDrive\code\michat\MIGPT.py", line 116, in _init_data_hardware hardware_data = await self.mina_service.device_list() File "D:\OneDrive\code\michat\MIGPT.py", line 92, in init_all_data await self._init_data_hardware() File "D:\OneDrive\code\michat\MIGPT.py", line 199, in run_forever await self.init_all_data(session) File "D:\OneDrive\code\michat\MIGPT.py", line 304, in <module> asyncio.run(miboy.run_forever()) Exception: Error https://api2.mina.mi.com/admin/v2/device_list?master=0&requestId=app_ios_5s0fSJ4RH6hL8AKoqzZcU91yPgTivj: Login failed

尝试登录:
https://api2.mina.mi.com/admin/v2/device_list?master=0&requestId=app_ios_5s0fSJ4RH6hL8AKoqzZcU91yPgTivj
返回:
HTTP Status 401 – Unauthorized

@jjiikkkk
Copy link

jjiikkkk commented Apr 9, 2023

很多人都是账号和密码登录不上去

@wujunkui
Copy link

wujunkui commented Jun 6, 2024

先去小米官网登录一下,再执行程序就好了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants