Merge branch 'master' of github.com:argrento/huami-token

remotes/piggz/master
Kirill Snezhko 2021-04-30 18:48:04 +03:00
commit c6c0d7971a
4 zmienionych plików z 44 dodań i 4 usunięć

Wyświetl plik

@ -23,7 +23,7 @@ with e-mail and password.
Huami servers. Huami servers.
3. Clone this repo: 3. Clone this repo:
```git clone https://github.com/argrento/huami-token.git``` ```git clone https://github.com/argrento/huami-token.git```
4. Install requirements: `pip install -r requirements.txt` 4. Install requirements: `pip3 install -r requirements.txt`
## Usage ## Usage
``` ```
@ -56,7 +56,7 @@ Run script with your credentials: `python huami_token.py --method amazfit --emai
Sample output: Sample output:
```bash ```bash
> python huami_token.py --method amazfit --email my_email --password password --bt_keys > python3 huami_token.py --method amazfit --email my_email --password password --bt_keys
Getting access token with amazfit login method... Getting access token with amazfit login method...
Token: ['UaFHW53RJVYwqXaa7ncPQ'] Token: ['UaFHW53RJVYwqXaa7ncPQ']
Logging in... Logging in...
@ -87,7 +87,7 @@ On this stage address will look like this: `https://hm.xiaomi.com/watch.do?code=
Sample output: Sample output:
```bash ```bash
> python huami_token.py --method xiaomi --bt_keys > python3 huami_token.py --method xiaomi --bt_keys
Getting access token with xiaomi login method... Getting access token with xiaomi login method...
Copy this URL to web-browser Copy this URL to web-browser

Wyświetl plik

@ -2,6 +2,26 @@
# pylint: disable=too-many-instance-attributes # pylint: disable=too-many-instance-attributes
# pylint: disable=invalid-name # pylint: disable=invalid-name
# Copyright (c) 2020 Kirill Snezhko
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Main module""" """Main module"""
import json import json
@ -351,7 +371,7 @@ if __name__ == "__main__":
print(f"\nChecking for device {idx}...") print(f"\nChecking for device {idx}...")
device.get_firmware(wearable) device.get_firmware(wearable)
elif int(wearable_id) in range(0, len(wearables)): elif int(wearable_id) in range(0, len(wearables)):
device.get_firmware(wearables[wearable_id]) device.get_firmware(wearables[int(wearable_id)])
else: else:
print("Wrong input!") print("Wrong input!")

20
urls.py
Wyświetl plik

@ -1,3 +1,23 @@
# Copyright (c) 2020 Kirill Snezhko
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module for storin urls and payloads fro different requests""" """Module for storin urls and payloads fro different requests"""
URLS = { URLS = {