Skip to content

Commit c13298e

Browse files
committed
fix + douyin batch
1 parent bed8cb5 commit c13298e

13 files changed

+54
-41
lines changed

README-en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Current Versions:
6969

7070
Expected that this useful-script extension will include the functions of [RevealDeletedFBMessages](https://github.com/HoangTran0410/RevealDeletedFBMessages) and [FBMediaDownloader](https://github.com/HoangTran0410/FBMediaDownloader)
7171

72-
[![Star History Chart](https://api.star-history.com/svg?repos=HoangTran0410/useful-script,HoangTran0410/FBMediaDownloader,HoangTran0410/RevealDeletedFBMessages&type=Date)](https://star-history.com/#HoangTran0410/useful-script&HoangTran0410/FBMediaDownloader&HoangTran0410/RevealDeletedFBMessages&Date)
72+
[![Star History Chart](https://api.star-history.com/svg?repos=Useful-Scripts-Extension/useful-script,HoangTran0410/FBMediaDownloader,HoangTran0410/RevealDeletedFBMessages&type=Date)](https://star-history.com/#Useful-Scripts-Extension/useful-script&HoangTran0410/FBMediaDownloader&HoangTran0410/RevealDeletedFBMessages&Date)
7373

7474
## For developer (Demo)
7575

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- [Dành cho dev (Demo)](#dành-cho-dev-demo)
1515
- [Contribute](#contribute)
1616

17-
Donate? Muốn hỗ trợ mình 1 ly cafe <3 [Donate tại đây](https://github.com/HoangTran0410/HoangTran0410/blob/main/DONATE.md)
17+
Donate? Muốn hỗ trợ mình 1 ly cafe <3 [Donate tại đây](https://hoangtran0410.github.io/HoangTran0410/DONATE)
1818

1919
## Giới thiệu
2020

@@ -69,7 +69,7 @@ Phiên bản hiện tại:
6969

7070
Dự kiến extension useful-script này sẽ bao gồm cả chức năng của [RevealDeletedFBMessages](https://github.com/HoangTran0410/RevealDeletedFBMessages)[FBMediaDownloader](https://github.com/HoangTran0410/FBMediaDownloader)
7171

72-
[![Star History Chart](https://api.star-history.com/svg?repos=HoangTran0410/useful-script,HoangTran0410/FBMediaDownloader,HoangTran0410/RevealDeletedFBMessages&type=Date)](https://star-history.com/#HoangTran0410/useful-script&HoangTran0410/FBMediaDownloader&HoangTran0410/RevealDeletedFBMessages&Date)
72+
[![Star History Chart](https://api.star-history.com/svg?repos=Useful-Scripts-Extension/useful-script,HoangTran0410/FBMediaDownloader,HoangTran0410/RevealDeletedFBMessages&type=Date)](https://star-history.com/#Useful-Scripts-Extension/useful-script&HoangTran0410/FBMediaDownloader&HoangTran0410/RevealDeletedFBMessages&Date)
7373

7474
## Dành cho dev (Demo)
7575

config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
version_check:
3-
"https://raw.githubusercontent.com/HoangTran0410/useful-script/main/manifest.json",
4-
source_code: "https://github.com/HoangTran0410/useful-script",
3+
"https://raw.githubusercontent.com/Useful-Scripts-Extension/useful-script/main/manifest.json",
4+
source_code: "https://github.com/Useful-Scripts-Extension/useful-script",
55
store:
66
"https://chrome.google.com/webstore/devconsole/ad27ff83-24b1-4348-810d-9cfdc30a5331/heoejcamgchindphgghdhmjpgmldnepl/edit/status",
77
};

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<body>
1111
<script>
12-
window.location.href = "https://hoangtran0410.github.io/useful-script/popup/popup.html"
12+
window.location.href = "https://Useful-Scripts-Extension.github.io/useful-script/popup/popup.html"
1313
</script>
1414
</body>
1515

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"manifest_version": 3,
44
"name": "Useful Scripts",
55
"description": "Scripts that can make your life faster and better",
6-
"homepage_url": "https://github.com/HoangTran0410/useful-script",
6+
"homepage_url": "https://github.com/Useful-Scripts-Extension/useful-script",
77
"version": "1.8",
88
"icons": {
99
"16": "./assets/icon16.png",

md/CHANGELOGS.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
- click to disable/enable for current website [source](/scripts/smoothScroll.js)
3636

3737
- Merge request
38-
- [fix: 🐛 fix fireship_vip script](https://github.com/HoangTran0410/useful-script/pull/28)
38+
- [fix: 🐛 fix fireship_vip script](https://github.com/Useful-Scripts-Extension/useful-script/pull/28)
3939
- [feat: youglish search
40-
](https://github.com/HoangTran0410/useful-script/pull/30)
41-
- [feat: youtube download video UI](https://github.com/HoangTran0410/useful-script/pull/31)
42-
- [style: 🪄 beautify ui for viewScriptSource](https://github.com/HoangTran0410/useful-script/pull/32)
40+
](https://github.com/Useful-Scripts-Extension/useful-script/pull/30)
41+
- [feat: youtube download video UI](https://github.com/Useful-Scripts-Extension/useful-script/pull/31)
42+
- [style: 🪄 beautify ui for viewScriptSource](https://github.com/Useful-Scripts-Extension/useful-script/pull/32)
4343
- More shortcuts: google trend, time.is, aiforthat, cobalt, nirsoft
4444

4545
</details>

popup/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,10 @@ async function initShowDonate() {
10461046
);
10471047
}
10481048
if (res.isDenied) {
1049-
window.open("https://github.com/HoangTran0410/useful-script", "_blank");
1049+
window.open(
1050+
"https://github.com/Useful-Scripts-Extension/useful-script",
1051+
"_blank"
1052+
);
10501053
}
10511054
}
10521055
}

popup/popup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h3>
2525
<a data-track="donate" target="_blank" href="https://hoangtran0410.github.io/HoangTran0410/DONATE">
2626
<i class="fa-solid fa-mug-saucer"></i> donate
2727
</a>
28-
<a data-track="github" target="_blank" href="https://github.com/HoangTran0410/useful-script">
28+
<a data-track="github" target="_blank" href="https://github.com/Useful-Scripts-Extension/useful-script">
2929
<i class="fa-solid fa-code"></i> source code
3030
</a>
3131
<a data-track="fanpage" target="_blank" href="https://www.facebook.com/groups/1154059318582088">

popup/tabs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ const tabs = [
199199
...CATEGORY.tiktok,
200200
scripts: [
201201
createTitle("--- Tiktok ---", "--- Tiktok ---"),
202+
s.tiktok_batchDownload,
202203
s.tiktok_downloadWatchingVideo,
203204
s.tiktok_downloadVideo,
204-
s.tiktok_batchDownload,
205205
createTitle("--- Douyin ---", "--- Douyin ---"),
206206
s.douyin_batchDownload,
207207
s.douyin_downloadWachingVideo,

scripts/createInvisibleText.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
},
2121
onClick: () =>
2222
window.open(
23-
"https://hoangtran0410.github.io/useful-script/scripts/createInvisibleText.html"
23+
"https://Useful-Scripts-Extension.github.io/useful-script/scripts/createInvisibleText.html"
2424
),
2525
},
2626
],

scripts/douyin_batchDownload.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default {
1010
vi: "Douyin - Tải hàng loạt",
1111
},
1212
description: {
13-
en: "",
14-
vi: "",
15-
img: "",
13+
en: "Select and download all douyin video (user profile, tiktok explore).<br/><br/> Same as tiktok batch download.",
14+
vi: "Tải hàng loạt video douyin (trang người dùng, trang tìm kiếm), có giao diện chọn video muốn tải.<br/><br/> Giống chức năng tải hàng loạt tiktok.",
15+
img: "/scripts/douyin_batchDownload.png",
1616
},
1717

1818
badges: [BADGES.new, BADGES.hot],
@@ -97,7 +97,7 @@ export default {
9797
<div class="ufs_floating_btn" @click="showModal = true">📥 {{totalCount}}</div>
9898
<div class="ufs_container" v-if="showModal" @click.self="showModal = false">
9999
<div class="ufs_popup">
100-
<h1 style="text-align:center">Douyin - <a target="_blank" href="https://github.com/HoangTran0410/useful-script">Useful Scripts</a></h1>
100+
<h1 style="text-align:center">Douyin - <a target="_blank" href="https://github.com/Useful-Scripts-Extension/useful-script">Useful Scripts</a></h1>
101101
<h2 style="text-align:center">Found {{totalCount}} videos</h2>
102102
103103
<div class="ufs_popup_header">
@@ -192,7 +192,10 @@ export default {
192192
search: "",
193193
sortBy: "index",
194194
sortDir: "asc",
195-
downloading: {},
195+
downloading: {
196+
video: null,
197+
audio: null,
198+
},
196199
selected: {},
197200
};
198201
},
@@ -227,7 +230,7 @@ export default {
227230
return Array.from(result.values());
228231
},
229232
videoTitle() {
230-
if (this.downloading.video) {
233+
if (Number.isInteger(this.downloading.video)) {
231234
return (
232235
"Downloading " +
233236
this.downloading.video +
@@ -244,7 +247,7 @@ export default {
244247
);
245248
},
246249
audioTitle() {
247-
if (this.downloading.audio) {
250+
if (Number.isInteger(this.downloading.audio)) {
248251
return (
249252
"Downloading " +
250253
this.downloading.audio +

scripts/douyin_batchDownload.png

131 KB
Loading

scripts/tiktok_batchDownload.js

+26-19
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default {
9696
<div class="ufs_floating_btn" @click="showModal = true">📥 {{totalCount}}</div>
9797
<div class="ufs_container" v-if="showModal" @click.self="showModal = false">
9898
<div class="ufs_popup">
99-
<h1 style="text-align:center">Tiktok - <a target="_blank" href="https://github.com/HoangTran0410/useful-script">Useful Scripts</a></h1>
99+
<h1 style="text-align:center">Tiktok - <a target="_blank" href="https://github.com/Useful-Scripts-Extension/useful-script">Useful Scripts</a></h1>
100100
<h2 style="text-align:center">Found {{totalCount}} videos</h2>
101101
102102
<div class="ufs_popup_header">
@@ -191,7 +191,10 @@ export default {
191191
search: "",
192192
sortBy: "index",
193193
sortDir: "asc",
194-
downloading: {},
194+
downloading: {
195+
video: null,
196+
audio: null,
197+
},
195198
selected: {},
196199
};
197200
},
@@ -225,7 +228,7 @@ export default {
225228
return Array.from(result.values());
226229
},
227230
videoTitle() {
228-
if (this.downloading.video) {
231+
if (Number.isInteger(this.downloading.video)) {
229232
return (
230233
"Downloading " +
231234
this.downloading.video +
@@ -242,7 +245,7 @@ export default {
242245
);
243246
},
244247
audioTitle() {
245-
if (this.downloading.audio) {
248+
if (Number.isInteger(this.downloading.audio)) {
246249
return (
247250
"Downloading " +
248251
this.downloading.audio +
@@ -313,22 +316,25 @@ export default {
313316
expectBlobTypes: ["video/mp4", "image/jpeg"],
314317
data: this.videoToDownload
315318
.map((_, i) => {
319+
const all = [];
316320
// image
317321
const imgs = _.imagePost?.images;
318322
if (imgs?.length) {
319-
return imgs.map((img, j) => ({
320-
url:
321-
img.imageURL?.urlList?.[1] ||
322-
img.imageURL?.urlList?.[0],
323-
filename:
324-
i +
325-
1 +
326-
"_" +
327-
(j + 1) +
328-
"_" +
329-
UfsGlobal.Utils.sanitizeName(_.id, false) +
330-
".jpg",
331-
}));
323+
all.push(
324+
...imgs.map((img, j) => ({
325+
url:
326+
img.imageURL?.urlList?.[1] ||
327+
img.imageURL?.urlList?.[0],
328+
filename:
329+
i +
330+
1 +
331+
"_" +
332+
(j + 1) +
333+
"_" +
334+
UfsGlobal.Utils.sanitizeName(_.id, false) +
335+
".jpg",
336+
}))
337+
);
332338
}
333339

334340
// video
@@ -337,15 +343,16 @@ export default {
337343
(b) => b.Bitrate === _.video.bitrate
338344
)?.PlayAddr?.UrlList || [];
339345
const bestUrl = urlList[urlList.length - 1];
340-
return {
346+
all.push({
341347
url: bestUrl || _.video.playAddr,
342348
filename:
343349
i +
344350
1 +
345351
"_" +
346352
UfsGlobal.Utils.sanitizeName(_.id, false) +
347353
".mp4",
348-
};
354+
});
355+
return all;
349356
})
350357
.flat()
351358
.filter((_) => _.url),

0 commit comments

Comments
 (0)