argrento/huami-token

404 in hm.xiaomi.com

TheSirCororo opened this issue · 6 comments

I run script with method xiaomi (python huami_token.py --method xiaomi --bt_keys)
Then I authorize by getted link with my Mi Account
Then I get redirected to 404 page (https://hm.xiaomi.com/watch.do?code=KSMOSCLOUDSRV_D049CD1E74*****) (url hidden)
I attempt to paste this to script and get empty result

+-------------------------------------------------------------------------------+
| ID  | ACT |        MAC        |                   auth_key                    |
|-----+-----+-------------------+-----------------------------------------------|
+-------------------------------------------------------------------------------+

Device: Mi Band 4C / Redmi Band
Phone: Redmi Note 10
App for linking mi band to account: Xiaomi Wearable (mi fit don't connect to my device)
And what I see:
I get different user id (is this mi account id?) in script (8703751884) and in mi wear (linked mi account id) (4151544115) but I enter same credentials

Hi!
That's weird, that you have 404 error. Also code in the url looks strange: normally it should start with ALSG_CLOUDSRV_.
Unfortunately, I have no devices, which can be used with Xiaomi Wear, thus I can not debug the error, sorry.

You get different user ids because Xiaomi Wear and Mi Fit use (probably) different APIs.

Does your Redmi Band has this model code: HMSH01GE?

Yes, my Mi Band 4c model code is HMSH01GE

Well, maybe I will order this device for testing.

You can say me that me need to give you required information (or we can go to private message (I speek Russian)

I've noticed weird results tweaking with hm servers if the account was registered with cn server.
I think isn't the band the issue but the login server

Your script is missing some logic.

The login returns some "cname". I think we should use that cname to post the requests to the right server (cn/us/eu)

So all the requests should reuse the righ "cname" as hostname of the requests.

I'm not sure if this is exactly the same problem, but my "logged in" user ID is different from my account ID, the hm.xiaomi.com page has a 404 error, and I'm getting none of my bluetooth devices