Files
mini_code/test.py
2026-01-05 08:55:13 +08:00

32 lines
2.3 KiB
Python

from curl_cffi import requests
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0',
'Accept': 'application/json, text/plain, */*',
# 'Accept-Encoding': 'gzip, deflate, br, zstd',
'Content-Type': 'application/json',
'sec-ch-ua-platform': '"Windows"',
'sec-ch-ua': '"Microsoft Edge WebView2";v="143", "Microsoft Edge";v="143", "Chromium";v="143", "Not A(Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'Origin': 'https://app.depinsim.com',
'Sec-Fetch-Site': 'same-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://app.depinsim.com/',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
}
json_data = {
'initData': 'query_id=AAHKGjNZAwAAAMoaM1n9Jm8g&user=%7B%22id%22%3A7938972362%2C%22first_name%22%3A%22%E7%90%B4%22%2C%22last_name%22%3A%22%E7%8E%8B%22%2C%22username%22%3A%22bgmztfjr%22%2C%22language_code%22%3A%22en%22%2C%22allows_write_to_pm%22%3Atrue%2C%22photo_url%22%3A%22https%3A%5C%2F%5C%2Ft.me%5C%2Fi%5C%2Fuserpic%5C%2F320%5C%2FtfN1ibQBmLhyPRirvlL0SAPLZe2_sJ_ds-9_ibc0e3R5yYVz0M4wOxmltsCJEZ7F.svg%22%7D&auth_date=1767550045&signature=4v_J54Qe9yTFNnkoa69Pq9yy1yiL4H4d8qV354gcSjhogRxFLKJde9pFT44Tb-cVFdqgBgPNFSFk_1l0s1w1Ag&hash=6ede983b3967f128eb1faa217afd7bfedf942312fcf6252ed4192dbb87f451de',
'couponCode': '',
}
response = requests.post('https://api.depinsim.com/base/tgLoginWithCoupon', headers=headers, json=json_data)
print(response.json()["data"])
# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
# data = '{"initData":"query_id=AAG-nFE1AwAAAL6cUTWXBDTZ&user=%7B%22id%22%3A7336991934%2C%22first_name%22%3A%22Annie%22%2C%22last_name%22%3A%22Holland%22%2C%22username%22%3A%22dockerse%22%2C%22language_code%22%3A%22zh-hans%22%2C%22allows_write_to_pm%22%3Atrue%2C%22photo_url%22%3A%22https%3A%5C%2F%5C%2Ft.me%5C%2Fi%5C%2Fuserpic%5C%2F320%5C%2FvKyPZp8vuNPAS3qtPTMX5pckp-xCdrOYuct7P6MGse7csZ2PXUs6HeWfQiu7Gzpm.svg%22%7D&auth_date=1767549051&signature=nVXsDAuvmnu-ond_wMmPSXe1ZZVreM3VRxWLMNr2vhBYAyXG40pqz7tgHeaVnMQvP6GrrQ6Z3EWzyxzPdoaxCw&hash=4525486fb5719723dd57b6a0d42785b8085726103ae850b297b4be251af3de6b","couponCode":""}'
# response = requests.post('https://api.depinsim.com/base/tgLoginWithCoupon', headers=headers, data=data)