-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis.ts
29 lines (23 loc) · 939 Bytes
/
analysis.ts
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
// get tik tok data from api
// * from https://github.com/szdc/tiktok-api
import TikTokAPI, { getRequestParams } from 'tiktok-api';
// Required - a method that signs the URL with anti-spam parameters
// You must provide an implementation yourself to successfully make
// most requests with this library.
const signURL = async (url: any, ts: any, deviceId: any) => {
const as = 'anti-spam parameter 1';
const cp = 'anti-spam parameter 2'
const mas = 'anti-spam parameter 3';
return `${url}&as=${as}&cp=${cp}&mas=${mas}`;
}
// Required - device parameters
// You need to source these using a man-in-the-middle proxy such as mitmproxy,
// CharlesProxy or PacketCapture (Android)
const params = getRequestParams({
device_id: '<device_id>',
fp: '<device_fingerprint>',
iid: '<install_id>',
openudid: '<device_open_udid>',
});
const api = new TikTokAPI(params, { signURL });
// You are now able to make successful requests