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

Function run

scripts/douyin_downloadAllVideoUser.js:61–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 };
60
61 var run = async function () {
62 var result = [];
63 var hasMore = 1;
64 var sec_user_id = location.pathname.replace("/user/", "");
65 var max_cursor = 0;
66
67 console.log('Đang chuẩn bị tải video của "' + sec_user_id + '" ...');
68 while (hasMore == 1) {
69 var moredata = await getid(sec_user_id, max_cursor);
70 console.log(moredata);
71 hasMore = moredata["has_more"];
72 max_cursor = moredata["max_cursor"];
73 for (var item of moredata["aweme_list"] || []) {
74 try {
75 let url = item.video.play_addr.url_list[0];
76
77 if (url.startsWith("https")) {
78 result.push(url);
79 } else {
80 result.push(url.replace("http", "https"));
81 }
82 // console.clear();
83 console.log("Number of videos: " + result.length);
84 } catch (e) {
85 console.log("ERROR: ", e);
86 }
87 }
88 console.log(hasMore);
89 }
90 saveToFile(result.join("\n"));
91 alert(
92 "Link videos sẽ được lưu vào file .txt, thêm file này vào idm để tải hàng loạt."
93 );
94 };
95 run();
96 },
97 },

Callers 1

Calls 3

getidFunction · 0.85
saveToFileFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected