Skip to content

Commit 9e3c8ce

Browse files
committed
minor fix
1 parent 43427b5 commit 9e3c8ce

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

scripts/ggDrive_downloadAllVideosInFolder.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export default {
4747
<p style="max-width:200px">${name}</p><br/><br/>
4848
Lỗi: ${errors.length} video<br/>
4949
<div style="max-height:150px;overflow:auto">
50-
${errors.map(({ id, name, e }) => name).join("<br/>")}
50+
${errors
51+
.map(({ id, name, e }) => name + ": " + e.message)
52+
.join("<br/>")}
5153
</div>`);
5254
try {
5355
// prettier-ignore
@@ -58,6 +60,8 @@ export default {
5860
}
5961
}
6062

63+
if (!result.length) throw new Error("Không tải được video nào");
64+
6165
// =========== Render Data ===========
6266
let allUrls = {};
6367
let tableHtml = result

scripts/ggdrive_downloadVideo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const shared = {
146146

147147
async function getLink(docid) {
148148
let lastError;
149-
for (let u of ["", 0, 1, 2, 3, 4, 5, 6]) {
149+
for (let u of ["", 0, 1, 2]) {
150150
let res = await fetch(
151151
"https://drive.google.com/" +
152152
(u !== "" ? `u/${u}/` : "") +
@@ -158,8 +158,8 @@ export const shared = {
158158
let json = parse(text);
159159

160160
if (json?.status === "fail") {
161-
lastError = Error("FAILED: " + json.reason);
162-
console.log(u, lastError);
161+
lastError = "FAILED: " + json.reason;
162+
console.log(u, docid, lastError);
163163
continue;
164164
}
165165

@@ -180,7 +180,7 @@ export const shared = {
180180
return result;
181181
}
182182

183-
if (lastError) throw lastError;
183+
if (lastError) throw new Error(lastError);
184184
return null;
185185
}
186186

0 commit comments

Comments
 (0)