Skip to content

Commit 9215a86

Browse files
committed
folder name
1 parent 92b5724 commit 9215a86

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/tiktok_batchDownload.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ export default {
7474
document.documentElement.appendChild(div);
7575

7676
const formatter = UfsGlobal.Utils.getNumberFormatter("compactShort");
77+
function getNow() {
78+
// return year + month + day + hour + minute + second
79+
const day = new Date();
80+
return (
81+
[day.getFullYear(), day.getMonth() + 1, day.getDate()].join("-") +
82+
"_" +
83+
[day.getHours(), day.getMinutes(), day.getSeconds()].join("-")
84+
);
85+
}
7786

7887
const app = new Vue({
7988
template: /*html*/ `
@@ -290,7 +299,7 @@ export default {
290299
if (!total) return;
291300
let success = 0;
292301
await download({
293-
folderName: "tiktok_videos",
302+
folderName: "tiktok_videos_" + getNow(),
294303
expectBlobTypes: ["video/mp4", "image/jpeg"],
295304
data: this.videoToDownload
296305
.map((_, i) => {
@@ -345,7 +354,7 @@ export default {
345354
if (!total) return;
346355
let success = 0;
347356
await download({
348-
folderName: "tiktok_musics",
357+
folderName: "tiktok_musics_" + getNow(),
349358
data: this.audioToDownload.map((_, i) => ({
350359
url: _.music.playUrl,
351360
filename:

0 commit comments

Comments
 (0)