46 lines
1.8 KiB
Python
46 lines
1.8 KiB
Python
import requests, time, json
|
|
|
|
token_id = '1291378'
|
|
wx_signature = '8aab9d16b538ed83b02974937e90a0d70388020b'
|
|
timestamp = str(int(time.time()))
|
|
|
|
headers = {
|
|
'Host': 'bike.sdlongren.com',
|
|
'hsf-x-signature': wx_signature,
|
|
'hsf-x-timestamp': timestamp,
|
|
'hsf-x-tokenid': token_id,
|
|
'xweb_xhr': '1',
|
|
'platform': 'xiaobai',
|
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090c38)XWEB/8518',
|
|
'content-type': 'application/json',
|
|
'accept': '*/*',
|
|
'referer': 'https://servicewechat.com/wx10426ca961518f43/98/page-frame.html',
|
|
}
|
|
|
|
tests = [
|
|
# GET /user/packages - 从JS逆向得到的"我的卡包"
|
|
('GET', '/user/packages', None),
|
|
# 看看/user/info 里的 package 和 memberPackageCount
|
|
('GET', '/user/info', None),
|
|
# 可能的变体路径
|
|
('GET', '/user/package', None),
|
|
('GET', '/user/memberPackage', None),
|
|
('GET', '/user/myPackage', None),
|
|
('GET', '/packages/user', None),
|
|
('GET', '/packages/my', None),
|
|
]
|
|
|
|
for method, path, body in tests:
|
|
url = f'https://bike.sdlongren.com{path}'
|
|
if method == 'GET':
|
|
resp = requests.get(url, headers=headers, timeout=10, verify=False)
|
|
else:
|
|
resp = requests.post(url, headers=headers, json=body, timeout=10, verify=False)
|
|
data = resp.json()
|
|
print(f'=== {method} {path} === rtn_code={data.get("rtn_code")} code={data.get("code")}')
|
|
if data.get('rtn_code') == 0 and data.get('data'):
|
|
for k, v in data['data'].items():
|
|
if 'package' in k.lower() or 'card' in k.lower() or 'member' in k.lower() or 'count' in k.lower():
|
|
print(f' {k}: {str(v)[:200]}')
|
|
print()
|