2021-04-03 21:17:45 +02:00
|
|
|
# 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"""
|
|
|
|
|
2020-11-24 23:12:25 +01:00
|
|
|
URLS = {
|
|
|
|
'login_xiaomi': 'https://account.xiaomi.com/oauth2/authorize?skip_confirm=false&'
|
|
|
|
'client_id=2882303761517383915&pt=0&scope=1+6000+16001+20000&'
|
2021-04-03 21:17:45 +02:00
|
|
|
'redirect_uri=https%3A%2F%2Fhm.xiaomi.com%2Fwatch.do&'
|
|
|
|
'_locale=en_US&response_type=code',
|
2020-11-24 23:12:25 +01:00
|
|
|
'tokens_amazfit': 'https://api-user.huami.com/registrations/{user_email}/tokens',
|
|
|
|
'login_amazfit': 'https://account.huami.com/v2/client/login',
|
|
|
|
'devices': 'https://api-mifit-us2.huami.com/users/{user_id}/devices',
|
2021-05-31 19:47:17 +02:00
|
|
|
'agps': 'https://{server}.huami.com/apps/com.huami.midong/fileTypes/{pack_name}/files',
|
2020-11-24 23:12:25 +01:00
|
|
|
'data_short': 'https://api-mifit-us2.huami.com/users/{user_id}/deviceTypes/4/data',
|
2021-04-03 21:17:45 +02:00
|
|
|
'logout': 'https://account-us2.huami.com/v1/client/logout',
|
|
|
|
'fw_updates': 'https://api-mifit-us2.huami.com/devices/ALL/hasNewVersion'
|
2020-11-24 23:12:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PAYLOADS = {
|
|
|
|
'login_xiaomi': None,
|
|
|
|
'tokens_amazfit': {
|
|
|
|
'state': 'REDIRECTION',
|
|
|
|
'client_id': 'HuaMi',
|
|
|
|
'password': None,
|
|
|
|
'redirect_uri': 'https://s3-us-west-2.amazonws.com/hm-registration/successsignin.html',
|
|
|
|
'region': 'us-west-2',
|
|
|
|
'token': 'access',
|
|
|
|
'country_code': 'US'
|
|
|
|
},
|
|
|
|
'login_amazfit': {
|
2021-04-03 21:17:45 +02:00
|
|
|
'dn': 'account.huami.com,api-user.huami.com,app-analytics.huami.com,'
|
|
|
|
'api-watch.huami.com,'
|
2020-11-24 23:12:25 +01:00
|
|
|
'api-analytics.huami.com,api-mifit.huami.com',
|
2021-04-03 21:17:45 +02:00
|
|
|
'app_version': '5.9.2-play_100355',
|
2020-11-24 23:12:25 +01:00
|
|
|
'source': 'com.huami.watch.hmwatchmanager',
|
|
|
|
'country_code': None,
|
|
|
|
'device_id': None,
|
|
|
|
'third_name': None,
|
|
|
|
'lang': 'en',
|
|
|
|
'device_model': 'android_phone',
|
|
|
|
'allow_registration': 'false',
|
|
|
|
'app_name': 'com.huami.midong',
|
|
|
|
'code': None,
|
|
|
|
'grant_type': None
|
|
|
|
},
|
|
|
|
'devices': {
|
2021-04-03 21:17:45 +02:00
|
|
|
'apptoken': None,
|
|
|
|
# 'enableMultiDevice': 'true'
|
2020-11-24 23:12:25 +01:00
|
|
|
},
|
|
|
|
'agps': {
|
|
|
|
'apptoken': None
|
|
|
|
},
|
|
|
|
'data_short': {
|
|
|
|
'apptoken': None,
|
|
|
|
'startDay': None,
|
|
|
|
'endDay': None
|
|
|
|
},
|
|
|
|
'logout': {
|
|
|
|
'login_token': None
|
|
|
|
},
|
2021-04-03 21:17:45 +02:00
|
|
|
'fw_updates': {
|
|
|
|
'productionSource': None,
|
|
|
|
'deviceSource': None,
|
|
|
|
'fontVersion': '0',
|
|
|
|
'fontFlag': '0',
|
|
|
|
'appVersion': '5.9.2-play_100355',
|
|
|
|
'firmwareVersion': None,
|
|
|
|
'hardwareVersion': None,
|
|
|
|
'support8Bytes': 'true'
|
|
|
|
}
|
|
|
|
}
|