Skip to content

Commit 4192924

Browse files
committed
little update
1 parent 708f46d commit 4192924

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

scripts/ggdrive_downloadPdf.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default {
1919
vi: "GG Drive - Tải PDF",
2020
},
2121
description: {
22-
en: "Download google drive PDF file that dont have download button",
23-
vi: "Tải file PDF không có nút download trên google drive",
22+
en: "Download google drive PDF file that dont have download button. Pages will be convert to image, cannot edit.",
23+
vi: "Tải file PDF không có nút download trên google drive. Tải về định dạng hình ảnh, không thể sửa nội dung.",
2424
},
2525

2626
whiteList: ["https://drive.google.com/file/d/*"],
@@ -105,7 +105,11 @@ export default {
105105
let canvasElement = document.createElement("canvas");
106106
let con = canvasElement.getContext("2d");
107107

108-
let checkImagesLoadedInterval = setInterval(() => {
108+
if (window.ufs_checkImagesLoadedInterval) {
109+
clearInterval(window.ufs_checkImagesLoadedInterval);
110+
}
111+
112+
window.ufs_checkImagesLoadedInterval = setInterval(() => {
109113
let imgs = Array.from(
110114
document.querySelectorAll("img[src^='blob:']")
111115
).filter((_) => _.complete);
@@ -115,9 +119,17 @@ export default {
115119
`${imgs.length}/${pageCount}` +
116120
`(${getTime()}s)`;
117121

122+
let errorPage = Array.from(
123+
document.querySelectorAll(".ndfHFb-c4YZDc-bN97Pc-u0pjoe-haAclf")
124+
);
125+
126+
if (errorPage.length) {
127+
info.innerText += `\nCó ${errorPage.length} trang không tải được.`;
128+
}
129+
118130
if (imgs.length === pageContainers.length) {
119131
info.innerText = "Đang tạo PDF...";
120-
clearInterval(checkImagesLoadedInterval);
132+
clearInterval(window.ufs_checkImagesLoadedInterval);
121133

122134
let pdf;
123135
for (let i = 0; i < imgs.length; i++) {

working_note.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
- [ ] Youtube local download => lấy data từ ytplayer.config.args.raw_player_response
1818

1919
- [ ] html2img khá ngon, nhưng chưa biết xài vô cái gì
20+
21+
- [ ] Crack tải pdf trên tailieugiangday.vn dễ vl

0 commit comments

Comments
 (0)