MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / getid

Function getid

scripts/douyin_downloadAllVideoUser.js:18–51  ·  view source on GitHub ↗
(sec_user_id, max_cursor)

Source from the content-addressed store, hash-verified

16 onClick: () => {
17 alert("Mở console (F12) để xem tiến trình tải video.");
18 var getid = async function (sec_user_id, max_cursor) {
19 var res = await fetch(
20 "https://www.douyin.com/aweme/v1/web/aweme/post/?device_platform=webapp&aid=6383&channel=channel_pc_web&sec_user_id=" +
21 sec_user_id +
22 "&max_cursor=" +
23 max_cursor,
24 {
25 headers: {
26 accept: "application/json, text/plain, */*",
27 "accept-language": "vi",
28 "sec-ch-ua":
29 '"Not?A_Brand";v="8", "Chromium";v="108", "Microsoft Edge";v="108"',
30 "sec-ch-ua-mobile": "?0",
31 "sec-ch-ua-platform": '"Windows"',
32 "sec-fetch-dest": "empty",
33 "sec-fetch-mode": "cors",
34 "sec-fetch-site": "same-origin",
35 },
36 referrer: location.href,
37 // "https://www.douyin.com/user/MS4wLjABAAAA5A-hCBCTdv102baOvaoZqg7nCIW_Bn_YBA0Aiz9uYPY",
38 referrerPolicy: "strict-origin-when-cross-origin",
39 body: null,
40 method: "GET",
41 mode: "cors",
42 credentials: "include",
43 }
44 );
45 try {
46 res = await res.json();
47 } catch (e) {
48 res = await getid(sec_user_id, max_cursor);
49 }
50 return res;
51 };
52
53 var saveToFile = function (text) {
54 var blob = new Blob([text], { type: "text/plain" });

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected