-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathsearch.js
More file actions
34 lines (30 loc) · 857 Bytes
/
Copy pathsearch.js
File metadata and controls
34 lines (30 loc) · 857 Bytes
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
import axios from 'axios';
import { token } from './get-token.js';
try {
const gettoken = await token();
const url = "https://sapi.dramaboxdb.com/drama-box/search/suggest";
const headers = {
"User-Agent": "okhttp/4.10.0",
"Accept-Encoding": "gzip",
"Content-Type": "application/json",
"tn": `Bearer ${gettoken.token}`,
"version": "430",
"vn": "4.3.0",
"cid": "DRA1000042",
"package-name": "com.storymatrix.drama",
"apn": "1",
"device-id": gettoken.deviceid,
"language": "in",
"current-language": "in",
"p": "43",
"time-zone": "+0800",
"content-type": "application/json; charset=UTF-8"
};
const data = {
keyword: "pewaris", // keyword pencarian
};
const res = await axios.post(url, data, { headers })
console.log(res.data.data.suggestList); // output list drama yang dicari
} catch (error) {
console.error(error);
}