URL参数格式更新

This commit is contained in:
Jerry Yan 2020-12-06 11:14:10 +08:00
parent ecdcde9230
commit 9e1b725c0c

45
api.py
View File

@ -6,16 +6,42 @@ import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
DEBUG = False DEBUG = False
# 自己抓的自己设备的参数,建议开发者自己抓一个长期使用
# 如果有大佬破解初次激活设备时的数据也行,可以自己生成一堆用
CUSTOM_INFO = {
'iid': "96159232732",
'device_id': "55714661189",
'cdid': "ed4295e8-5d9a-4cb9-b2a2-04009a3baa2d",
'openudid': "70d6668d41512c39",
'aid': "32",
'channel': "xiaomi",
'device_brand': "Xiaomi",
'device_type': "MI+8+SE",
'os_api': "28",
'os_version': "9",
'rom_version': "miui_V12_V12.0.2.0.QEBCNXM",
}
VERSION_INFO = {
'app_name': "video_article",
'version_code': "926",
'version_code_full': "92609",
'version_name': "9.2.6",
'ab_version': "941090,785218,668858,1046292,1073579,830454,956074,929436,797199,1135476,1179370,994679,959010,"
"900042,1113833,668854,1193963,901277,1043330,1038721,994822,1002058,1230687,1189797,1143356,1143441,"
"1143501,1143698,1143713,1371009,1243997,1392586,1395695,1395486,1398858,668852,668856,668853,"
"1186421,668851,668859,999124,668855,1039075",
'manifest_version_code': "518",
'tma_jssdk_version': "1830001",
# 一个定值,几个版本换设备都没变过
'oaid': "a625f466e0975d42",
}
COMMON_GET_PARAM = ( COMMON_GET_PARAM = (
"&iid=844059075938396&device_id=71008241150&channel=xiaomi&aid=32&app_name=video_article&version_code=926" "&iid={iid}&device_id={device_id}&channel={channel}&aid={aid}&app_name={app_name}&version_code={version_code}&"
"&version_name=9.2.6&device_platform=android&ab_version=668852,668853,668858,668851,668859,668856,668855," "version_name={version_name}&device_platform=android&ab_version={ab_version}&device_type={device_type}&"
"668854,1477978,994679,2186472,1477978,1189797,1635895,1631832,994822,900042,956074,1143356,1046292,1481027," "device_brand={device_brand}&language=zh&os_api={os_api}&os_version={os_version}&openudid={openudid}&fp=a_fake_fp&"
"929436,994679,1419059,1073579,668854,1143441,668852,668853,941090,668858,668851,668859,668856,1639440,1630487&" "manifest_version_code={manifest_version_code}&update_version_code={version_code_full}&_rticket={{TIMESTAMP:.0f}}&"
"device_typeMI+9&device_type=MI 9&device_brand=Xiaomi&language=zh" "_rticket={{TIMESTAMP:.0f}}&cdid_ts={{TIMESTAMP:.0f}}&tma_jssdk_version={tma_jssdk_version}&"
"&os_api=29&os_version=10&openudid=4aeb1e2b627697be&manifest_version_code=518&update_version_code=92609" "rom_version={rom_version}&oaid={oaid}&cdid={cdid}").format_map({**CUSTOM_INFO, **VERSION_INFO})
"&_rticket={TIMESTAMP:.0f}&_rticket={TIMESTAMP:.0f}&cdid_ts={TIMESTAMP:.0f}&fp=a_fake_fp&tma_jssdk_version=1830001"
"&rom_version=miui_V12_V12.0.5.0.QFACNXM&oaid=693ea85657ef38ca"
"&cdid=ed4295e8-5d9a-4cb9-b2a2-04009a3baa2d&oaid=a625f466e0975d42")
SEARCH_USER_API = ( SEARCH_USER_API = (
"https://search-hl.ixigua.com/video/app/search/search_content/?format=json" "https://search-hl.ixigua.com/video/app/search/search_content/?format=json"
"&fss=search_subtab_switch&target_channel=video_search&keyword_type=search_subtab_switch&offset=0&count=10" "&fss=search_subtab_switch&target_channel=video_search&keyword_type=search_subtab_switch&offset=0&count=10"
@ -32,6 +58,7 @@ COMMON_HEADERS = {
"X-SS-DP": "32", "X-SS-DP": "32",
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 10) VideoArticle/9.2.6 cronet/TTNetVersion:828f6f3c 2020-09-06 " "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 10) VideoArticle/9.2.6 cronet/TTNetVersion:828f6f3c 2020-09-06 "
"QuicVersion:7aee791b 2020-06-05", "QuicVersion:7aee791b 2020-06-05",
# 最好别加brrequests库好像自带没法解析
"Accept-Encoding": "gzip, deflate" "Accept-Encoding": "gzip, deflate"
} }