argrento / huami-token

Script to obtain watch or band bluetooth token from Huami servers
MIT License
412 stars 94 forks source link

ValueError: Login error. Error: 0117 #42

Open evan0625 opened 3 years ago

evan0625 commented 3 years ago

When I use the command ‘python3 huami_token.py --method xiaomi --bt_keys’, I have obtained the code and entered it,such as https://hm.xiaomi.com/watch.do?code=C3_XXXXXXXXXXXXXXXX I make an error, as follows: ValueError: Login error. Error: 0117 I print return msg,that is: {'error_code': '0117', 'data': {'wechatPhone': None, 'accessToken': 'V3_xxxxxxxxxxxxxxxxx', 'refreshToken': 'R3_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}}

When I use the command 'python3 huami_token.py --method amazfit --email xxxx@xxx.com --password xxxx --bt_keys', I make an error, as follows: ValueError: Wrong E-mail or Password.Error: ['401'] I print return msg,that is : {'error': ['401'], 'state': ['REDIRECTION'], 'region': ['cn-northwest-1']}

Thanks.

argrento commented 3 years ago

Hi! As a workaround you can try replace us-west-2 with cn-northwest-1 here: https://github.com/argrento/huami-token/blob/d407d4abdb0c2f4389b75d75e5c1fa0fc7e6861f/urls.py#L44

If you try this, please post the result here.

evan0625 commented 3 years ago

Hi! As a workaround you can try replace us-west-2 with cn-northwest-1 here:

https://github.com/argrento/huami-token/blob/d407d4abdb0c2f4389b75d75e5c1fa0fc7e6861f/urls.py#L44

If you try this, please post the result here.

I tried your method, but it didn't work。 I print return msg,that is also : {'error': ['401'], 'state': ['REDIRECTION'], 'region': ['cn-northwest-1']} I think it got the IP address。

argrento commented 3 years ago

I have obtained the code and entered it,such as https://hm.xiaomi.com/watch.do?code=C3_XXXXXXXXXXXXXXXX

I've never seen such a code.

Also which app do you normally use, Zepp or Mi Fit?

evan0625 commented 3 years ago

I have obtained the code and entered it,such as https://hm.xiaomi.com/watch.do?code=C3_XXXXXXXXXXXXXXXX

I've never seen such a code.

Also which app do you normally use, Zepp or Mi Fit?

I use Zepp。 C3_XXXXXXXXXXXXXXXX is Hidden by me,that is just a string。 I used an old xiaomi account,it is no mistake,but i can not get authkey。 I think Xiaomi has disabled this function。

Luanxins commented 3 years ago

哈,这个问题是因为小米账号的问题,而不是作者软件的问题;自己在小米运动重新注册一下账号就ok了。

This problem is due to the mi account, not the author's software; Oneself re - register an account in millet movement is ok

evan0625 commented 3 years ago

哈,这个问题是因为小米账号的问题,而不是作者软件的问题;自己在小米运动重新注册一下账号就ok了。

This problem is due to the mi account, not the author's software; Oneself re - register an account in millet movement is ok

After following your suggestion, it succeeded. Thank you very much。

radu022003 commented 2 years ago

哈,这个问题是因为小米账号的问题,而不是作者软件的问题;自己在小米运动重新注册一下账号就ok了。 This problem is due to the mi account, not the author's software; Oneself re - register an account in millet movement is ok

After following your suggestion, it succeeded. Thank you very much。

Can you please give more details on this? As I am having the same issue and I don't understand what account to re-register and where

pointout commented 2 years ago

I also get the error:

File "D:\xxxxxxxx\huami-token\huami_token.py", line 116, in login
    raise ValueError(f"Login error. Error: {login_result['error_code']}")
    ValueError: Login error. Error: 0117

I try to get the token for a MiBand 5. I get this error for a new account as well as with an longer existing account with another freed MiBand5. Just tried this for checking, if the error depends on the new acount. Can somebody explain what causes this error an what to do? I do not understand this:

Oneself re - register an account in millet movement is ok

(Google is translating this with "register new to "xiaomi Sports"" - But there is no such app in the app store.)

The MiBand is paired with the Zepp life App.

EstelZhao commented 1 year ago

I also get the error:

File "D:\xxxxxxxx\huami-token\huami_token.py", line 116, in login
    raise ValueError(f"Login error. Error: {login_result['error_code']}")
    ValueError: Login error. Error: 0117

I try to get the token for a MiBand 5. I get this error for a new account as well as with an longer existing account with another freed MiBand5. Just tried this for checking, if the error depends on the new acount. Can somebody explain what causes this error an what to do? I do not understand this:

Oneself re - register an account in millet movement is ok

(Google is translating this with "register new to "xiaomi Sports"" - But there is no such app in the app store.)

The MiBand is paired with the Zepp life App.

you should sign in zeep life with your Xiaomi account, otherwise it will post error.