-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.py
62 lines (54 loc) · 2.04 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from json import loads
from random import choice
from utils.api import Utils
from utils.sign import sign
from utils.client import get_client
from urllib.parse import urlencode
from hashlib import md5
from metasec_tt import Signer
if __name__ == '__main__':
devices = open('./data/devices.txt', 'r').read().splitlines()
device = loads(choice(devices))
client = get_client()
phone = '+XX XXXXXXXX'
payload = urlencode({
"check_register" : 1,
"auto_read" : 1,
"account_sdk_source": "app",
"unbind_exist" : 35,
"mix_mode" : 1,
"mobile" : Utils.encrypt(phone),
"is6Digits" : 1,
"multi_login" : 1,
"type" : 3731
})
params = Utils.get_params(device, '25.6.2')
headers = {
**Signer.sign(params, payload),
"accept-encoding" : "gzip",
"sdk-version" : "2",
"passport-sdk-version" : "19",
"x-ss-req-ticket" : "1675464756985",
"x-tt-bypass-dp" : "1",
"x-vc-bdturing-sdk-version" : "2.2.1.i18n",
"x-tt-dm-status" : "login=0;ct=0;rt=7",
"x-tt-store-region" : "ie",
"x-tt-store-region-src" : "did",
"x-tt-store-region-did" : "ie",
"x-tt-store-region-uid" : "none",
"content-type" : "application/x-www-form-urlencoded; charset=UTF-8",
"host" : "api16-normal-c-useast1a.tiktokv.com",
"connection" : "Keep-Alive",
}
req = client.post(f"https://api16-normal-c-useast1a.tiktokv.com/passport/mobile/send_code/v1/?{params}",
headers = headers, data = payload)
print(req.json())
{
'data': {
'mobile': '+XX****XXXX',
'mobile_ticket':
'mobile_ticket_XXXXXXXXXXXXXXXXXXXXXXX',
'retry_time': 60
},
'message': 'success'
}