添加我的电脑
@@ -5548,7 +5762,7 @@ button.downloadSubtitle:disabled {
}, true)
// 美化分享页面
if (temp.page === "share") {
- base.waitForKeyElements(`iframe[src^="/buy/ad"]`, function (tag) {
+ base.waitForKeyElements(`iframe[src^="/buy/ad"]`, (tag) => {
tag.fadeOut();
}, true)
// 一朵可爱捏
@@ -5565,16 +5779,16 @@ button.downloadSubtitle:disabled {
display:none!important;
}
`, `.${mount}`);
- base.waitForKeyElements(`.KPDwCE`, function (tag) {
+ base.waitForKeyElements(`.KPDwCE`, (tag) => {
tag.css("background", "transparent");
}, true);
- base.waitForKeyElements(".share-list .KPDwCE .AuPKyz", function (tag) {
+ base.waitForKeyElements(".share-list .KPDwCE .AuPKyz", (tag) => {
tag.css("background", "transparent");
}, true);
- base.waitForKeyElements(`#layoutMain`, function (tag) {
+ base.waitForKeyElements(`#layoutMain`, (tag) => {
tag.css({ "border-radius": "24px" });
}, true)
- base.waitForKeyElements(".frame-content", function (tag) {
+ base.waitForKeyElements(".frame-content", (tag) => {
tag.css({ "margin": "auto" });
}, true)
}
@@ -5683,11 +5897,11 @@ button.downloadSubtitle:disabled {
.module-topToolBar,
.module-timeline-view .timeline-title-curday
{background:transparent!important;border-bottom:0}
- .MdLxwM{background :#EBE6E3!important}
+ .MdLxwM{background :#FFF!important}
.aside-absolute-container{position:absolute!important}
- .aside-absolute-container .QGOvsxb .remainingSpaceUi_span{background:#8af248!important;border-radius:10px 0 0 10px;border-right:#EBE6E3 1px solid;border-bottom:#EBE6E3 1px solid}
+ .aside-absolute-container .QGOvsxb .remainingSpaceUi_span{background:#8af248!important;border-radius:10px 0 0 10px;border-right:#FFF 1px solid;border-bottom:#FFF 1px solid}
.xtJbHcb .CDaavKb .KQcHyA{background:rgb(244,207,0)!important;padding:8px 15px}
- .xtJbHcb .web-header-nav-new-version-inner{background:${temp.color}!important;padding:8px 15px;line-height:15px;width:auto;height:auto}
+ .xtJbHcb .web-header-nav-new-version-inner{background:var(--pl-c)!important;padding:8px 15px;line-height:15px;width:auto;height:auto}
a{transition:all.2s!important}
#bd-main .bd-left{margin:auto!important}
.verify-input input{padding-left:0!important;text-align:center!important}
@@ -5788,61 +6002,61 @@ button.downloadSubtitle:disabled {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "home") return;
const $button = $(``);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$baidu.mount.main, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "main") return;
const $button = $(``);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$baidu.mount.main, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "youth") return;
const $button = $(``);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$baidu.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "share") return;
@@ -5852,34 +6066,34 @@ button.downloadSubtitle:disabled {
下载助手
`)
element.after($button);
- })
+ });
},
addInitButton() {
base.waitForKeyElements(config.$baidu.mount.home, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "home") return;
- const $button = $(`
`);
+ const $button = $(`
`);
$button.click(base.showInitDialog);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$baidu.mount.main, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || (temp.page !== "main" && temp.page !== "youth")) return;
const $button = $(`
-
`);
$button.click(base.showInitDialog);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$baidu.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "share") return;
const $button = $(`
-
+
点我点亮
`)
$button.click(base.showInitDialog);
element.after($button);
- })
+ });
},
async getFilesUrl(items, token) {
if (base.isType(items) !== "array") return [];
@@ -5943,7 +6157,7 @@ button.downloadSubtitle:disabled {
if (res.errno || res.errmsg) {
batch.forEach(item => item.dlink = `获取下载地址失败,${(res.errno || res.errmsg) ? "服务器说:" + (res.errno && res.errmsg ? res.errno + " - " + res.errmsg : (res.errmsg || res.errno)) + "。" : "刷新后再试试吧~"}`);
} else {
- throw new Error("提示:
获取下载链接失败,刷新网页后再试试吧~");
+ throw new Error("提示:
获取下载地址失败,刷新网页后再试试吧~");
}
}
@@ -5956,7 +6170,7 @@ button.downloadSubtitle:disabled {
});
proc += res.list.length;
- $doc.find(".swal2-html-container").html(`已获取 ${proc} / ${items.length} 个链接`);
+ $doc.find(".swal2-html-container").html(`已获取 ${proc} / ${items.length} 个地址`);
// 批次间休息
if (i + size < pending.length) await base.sleep(1000);
@@ -6012,7 +6226,7 @@ button.downloadSubtitle:disabled {
if (res.errno || res.errmsg) {
item.dlink = `获取下载地址失败,${(res.errno || res.errmsg) ? "服务器说:" + (res.errno && res.errmsg ? res.errno + " - " + res.errmsg : (res.errmsg || res.errno)) + "。" : "刷新后再试试吧~"}`;
} else {
- throw new Error("提示:
获取下载链接失败,刷新网页后再试试吧~");
+ throw new Error("提示:
获取下载地址失败,刷新网页后再试试吧~");
}
}
@@ -6021,7 +6235,7 @@ button.downloadSubtitle:disabled {
temp.glinks.push({ "id": item.fs_id, "expires": (Date.now() + 4 * 60 * 60 * 1000), "data": res.list[0] });
proc++
- $doc.find(".swal2-html-container").html(`已获取 ${proc} / ${items.length} 个链接`);
+ $doc.find(".swal2-html-container").html(`已获取 ${proc} / ${items.length} 个地址`);
// 批次间休息
if (proc < pending.length) await base.sleep(1000);
@@ -6068,7 +6282,7 @@ button.downloadSubtitle:disabled {
message.info("提示:
稍后请在新标签页中授权助手哦~");
base.delValue("baidu_access_token");
await base.sleep(3300);
- GM_openInTab(config.$baidu.api.getAccessToken, { active: true, insert: true, setParent: true })
+ GM_openInTab(config.$baidu.api.getAccessToken, { active: true, insert: true, setParent: true });
let attempts = 0;
const interval = setInterval(() => {
if (base.getValue("baidu_access_token")) {
@@ -6086,10 +6300,10 @@ button.downloadSubtitle:disabled {
// 获取选择的文件列表
const selects = this.getSelectedList();
- if (selects.length === 0) throw new Error("提示:
请勾选要下载的文件哦~");
+ if (selects.length === 0) throw new Error("提示:
请先勾选要下载的文件哦~");
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
let files = selects.filter(f => !f.isdir);
const dirs = selects.filter(f => f.isdir);
@@ -6097,12 +6311,12 @@ button.downloadSubtitle:disabled {
if (dirs.length > 0) files = files.concat(await this.getFilesList(dirs, token, files.length));
if (!files.length) throw new Error("提示:
文件夹是空的哦~");
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
files = await this.getFilesUrl(files, token).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[百度网盘] 获取文件 URL 失败");
+ throw new Error(e?.message || e || "[百度网盘] 获取下载地址失败");
});
} else if (temp.page === "share") {
const shareData = await this.getShareData();
@@ -6115,37 +6329,45 @@ button.downloadSubtitle:disabled {
files = await this.getShareFilesUrl(files, shareData, token).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[百度网盘] 获取分享文件 URL 失败");
+ throw new Error(e?.message || e || "[百度网盘] 获取分享下载地址失败");
});
} else {
throw new Error("提示:
页面错误~");
}
- temp.links = [files, {
- isFolder: v => v.isdir === 1,
- getFileName: v => (v.server_filename || v.filename),
- getFileSize: v => v.size,
- getFileLink: v => {
- if (!v.dlink || !v.dlink.startsWith("http")) return v.dlink;
- const url = new URL(v.dlink);
- url.searchParams.set("access_token", token);
- return url.href;
+ temp.files = [files, {
+ get: {
+ dir: v => v.isdir === 1,
+ name: v => (v.server_filename || v.filename),
+ size: v => v.size,
+ link: v => {
+ if (!v.dlink || !v.dlink.startsWith("http")) return v.dlink;
+ const url = new URL(v.dlink);
+ url.searchParams.set("access_token", token);
+ return url.href;
+ },
},
- convert: {
- aria2: `--header "User-Agent:${config.$baidu.api.ua.downloadLink}"`,
- curl: `-A "${config.$baidu.api.ua.downloadLink}"`,
- bitcomet: `user_agent=${encodeURIComponent(config.$baidu.api.ua.downloadLink)}`
- },
- tooltip: config.$baidu.dom
+ headers: { "User-Agent": config.$baidu.api.ua.downloadLink },
+ convert: {},
+ dom: {
+ tooltip: config.$baidu.dom,
+ download: {
+ error: (error) => {
+ if (!error?.status) return ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
+ if (error?.status == 403) return ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
+ if (error?.status == 204 || error?.statusText === "IDM") return ` 服务说:链接已被 IDM 捕获~`;
+ }
+ }
+ }
}];
- base.showMainDialog(config.base.dom.button[temp.mode].title, base.generateDOM(temp.links), config.base.dom.button[temp.mode].footer);
+ base.showMainDialog(config.base.dom.method[temp.mode].title, download.generateDOM(), config.base.dom.method[temp.mode].footer);
},
getSelectedList() {
try {
let list = [];
// 3
const fileList = unsafeWindow.document.querySelector(".file-list");
- if (fileList?.__vue__?.allFileList?.[0]) list = fileList.__vue__.allFileList.filter(function (item) { return !!item.selected; });
+ if (fileList?.__vue__?.allFileList?.[0]) list = fileList.__vue__.allFileList.filter(item => !!item.selected);
// 2
const wpCore = unsafeWindow.document.querySelector(".wp-s-core-pan");
@@ -6157,7 +6379,7 @@ button.downloadSubtitle:disabled {
return base.clone(list);
} catch (e) {
- console.error(e);
+ base.console.error(e);
return [];
}
},
@@ -6235,7 +6457,7 @@ button.downloadSubtitle:disabled {
position: "center"
});
if (dialog.isConfirmed) {
- base.waitForKeyElements("button#auth-allow", function (element) {
+ base.waitForKeyElements("button#auth-allow", (element) => {
element[0].click();
}, true)
return;
@@ -6252,7 +6474,7 @@ button.downloadSubtitle:disabled {
showConfirmButton: false,
showDenyButton: false,
position: "bottom-end",
- })
+ });
}
} else if (/openapi.baidu.com\/oauth\/2.0\/login_success/.test(location.href)) {
const int = setInterval(async () => {
@@ -6286,7 +6508,7 @@ button.downloadSubtitle:disabled {
}
}, 10);
},
- didOpen: function (toast) {
+ didOpen(toast) {
toast.addEventListener("mouseenter", () => {
Swal.stopTimer();
});
@@ -6318,14 +6540,14 @@ button.downloadSubtitle:disabled {
*/
const $aliyun = {
addPageListener() {
- $doc.on("click", ".pl-button-save", async function (e) {
+ $doc.on("click", ".pl-button-save", async (e) => {
e.preventDefault();
const reactDomGrid = document.querySelector(config.$aliyun.mount.grid);
if (reactDomGrid) {
const dialog = await Swal.fire({
...temp.swalDefault,
title: "提示",
- html: `
请先切换到 列表视图 后再获取下载链接哦
`,
+ html: `
请先切换到 列表视图 后再获取下载地址哦
`,
icon: "info",
showCloseButton: true,
showDenyButton: true,
@@ -6334,7 +6556,7 @@ button.downloadSubtitle:disabled {
});
if (dialog.isConfirmed) {
document.querySelector(config.$aliyun.mount.switch).click();
- return message.success("提示:
切换为列表视图成功
请再获取一次下载链接吧~");
+ return message.success("提示:
切换为列表视图成功
请再获取一次下载地址吧~");
}
return false;
}
@@ -6346,144 +6568,24 @@ button.downloadSubtitle:disabled {
await base.sleep(500);
document.querySelector(`[class*="btn-save--"]`).click();
});
- $doc.on("click", ".listener-api-download.enhance", async function (e) {
- e.preventDefault();
- const status = base._EventFactory(e);
- const file = {
- index: status.item.data("index"),
- link: status.item.data("link"),
- name: status.item.data("name"),
- size: status.item.data("size") || 0,
- }
- base._resetData(file.index);
-
- // UI 初始化
- status.down_normal.hide();
- status.down_enhance.hide();
- status.down_idm.hide();
- status.link_message.hide();
- status.link_copy.hide();
-
- status.down_enhance_downing.find(".stop").show();
- status.down_enhance_downing.show();
-
- base.download(file.link, undefined, {
- ...file,
- onProgress: (data) => {
- const dprog = Math.min(data.progress, 100);
- status.down_enhance_downing.find(".pl-progress").css("--width", `${dprog}%`);
- status.down_enhance_downing.find(".pl-progress .text").text(`${dprog.toFixed(2)}% | 已存:${base.sizeFormat(data.loaded)} | 速度:${data.speedText} | 剩余:${data.etaText}`);
- }
- })
- .then(async (res) => {
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#55af28");
- base.blobDownload(res.response, file.name);
- await base.sleep(1000);
-
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress .text").html(`下载完成~ 浏览器下载框应该弹出来了哦~`);
- })
- .catch(async (error) => {
- base.console.error("【LinkSwift】Download(load)", error);
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress").css("--width", "100%");
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#cc3235");
- let estatus = `QAQ 下载出错~`;
- if (!error?.status) estatus += ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
- if (error?.status == 403) estatus += ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
- if (error?.status == 204 || error?.statusText === "IDM") estatus += ` 服务说:链接已被 IDM 捕获~`;
- status.down_enhance_downing.find(".pl-progress .text").html(estatus);
- status.down_enhance_downing.find(".pl-progress .text").css("white-space", "break-spaces");
- })
- });
- $doc.on("click", ".listener-idm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToIDM(target.data("link"), target.data("filename"), target.data("filesize"), { "Referer": `https://${location.host}/` });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-aria2-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToAria2(target.data("link"), target.data("filename"), [`Referer:https://${location.host}/`]);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-bitcomet-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"), { "referrer": `https://${location.host}/` });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-abdm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToABDM(target.data("link"), target.data("filename"), undefined);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
},
greenerPage() {
- base.waitForKeyElements(`[class*="share-list-banner"]`, function (tag) {
+ base.waitForKeyElements(`[class*="share-list-banner"]`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(`[class*="to-app"]`, function (tag) {
+ base.waitForKeyElements(`[class*="to-app"]`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(`[class*="btn-mobile-save"]`, function (tag) {
+ base.waitForKeyElements(`[class*="btn-mobile-save"]`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(`[class*="SplashScreenImg--close"]`, function (tag) {
+ base.waitForKeyElements(`[class*="SplashScreenImg--close"]`, (tag) => {
tag[0].click();
}, true);
- base.waitForKeyElements(`[class*="container"]`, function (tag) {
+ base.waitForKeyElements(`[class*="container"]`, (tag) => {
tag.find(`[class^="icon-close"]`).click();
}, true);
- base.waitForKeyElements(`[class*="popup_main_close"]`, function (tag) {
+ base.waitForKeyElements(`[class*="popup_main_close"]`, (tag) => {
tag[0].click();
}, true);
},
@@ -6502,7 +6604,7 @@ button.downloadSubtitle:disabled {
["138, 157, 255", base.hexToRgba(`${temp.color}D0`)],
]);
},
- svg: `
`,
+ svg: `
`,
addButton() {
base.waitForKeyElements(config.$aliyun.mount.home, (element) => {
temp.page = temp.main.detectPage();
@@ -6510,33 +6612,33 @@ button.downloadSubtitle:disabled {
const $button = $(`
${temp.main.svg}下载助手
`);
element.append($button);
- })
+ });
base.waitForKeyElements(config.$aliyun.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "share") return;
const $button = $(`
${temp.main.svg}下载助手
`);
$button.css({ "margin-right": "10px", "height": "36px", "width": "auto", "padding": "1px 30px" });
element.prepend($button);
- })
+ });
},
addInitButton() {
const $button = $(`
${temp.main.svg}点我点亮
`);
@@ -6546,13 +6648,13 @@ button.downloadSubtitle:disabled {
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "home") return;
$button.css({ "width": "auto" });
element.append($button);
- })
+ });
base.waitForKeyElements(config.$aliyun.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "share") return;
$button.css({ "margin-right": "10px", "height": "36px", "padding": "1px 30px", "width": "auto" });
element.prepend($button);
- })
+ });
},
async getLink() {
const reactDomGrid = document.querySelector(config.$aliyun.mount.grid);
@@ -6560,7 +6662,7 @@ button.downloadSubtitle:disabled {
const dialog = await Swal.fire({
...temp.swalDefault,
title: "提示",
- html: `
请先切换到 列表视图 后再获取下载链接哦
`,
+ html: `
请先切换到 列表视图 后再获取下载地址哦
`,
icon: "info",
showCloseButton: true,
showDenyButton: true,
@@ -6569,18 +6671,18 @@ button.downloadSubtitle:disabled {
});
if (dialog.isConfirmed) {
document.querySelector(config.$aliyun.mount.switch).click();
- return message.success("提示:
切换为列表视图成功
请再获取一次下载链接吧~");
+ return message.success("提示:
切换为列表视图成功
请再获取一次下载地址吧~");
}
return false;
}
// 获取选择的文件列表
let selects = this.getSelectedList();
- if (selects.length === 0) throw new Error("提示:
请勾选要下载的文件哦~");
+ if (selects.length === 0) throw new Error("提示:
请先勾选要下载的文件哦~");
if (selects.every(item => item.type !== "file")) throw new Error("提示:
请打开文件夹后再勾选文件~");
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
if (temp.page === "home") {
selects = selects.filter(item => item.type === "file");
@@ -6590,25 +6692,33 @@ button.downloadSubtitle:disabled {
}
selects = await this.getFilesUrl(selects, `${token.token_type} ${token.access_token}`).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[阿里云盘] 获取文件 URL 失败");
+ throw new Error(e?.message || e || "[阿里云盘] 获取下载地址失败");
});
} else {
throw new Error("提示:
页面错误~");
}
- temp.links = [selects, {
- isFolder: v => v.type === "folder",
- getFileName: v => v.name,
- getFileSize: v => v.size,
- getFileLink: v => (v.downloadUrl || v.url),
- convert: {
- aria2: `--header "Referer:https://${location.host}/"`,
- curl: `-e "https://${location.host}/"`,
- bitcomet: `&refer=${encodeURIComponent(`https://${location.host}/`)}`
+ temp.files = [selects, {
+ get: {
+ dir: v => v.type === "folder",
+ name: v => v.name,
+ size: v => v.size,
+ link: v => (v.downloadUrl || v.url),
},
- tooltip: config.$aliyun.dom
+ headers: {},
+ convert: {},
+ dom: {
+ tooltip: config.$aliyun.dom,
+ download: {
+ error: (error) => {
+ if (!error?.status) return ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
+ if (error?.status == 403) return ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
+ if (error?.status == 204 || error?.statusText === "IDM") return ` 服务说:链接已被 IDM 捕获~`;
+ }
+ }
+ }
}];
- base.showMainDialog(config.base.dom.button[temp.mode].title, base.generateDOM(temp.links), config.base.dom.button[temp.mode].footer);
+ base.showMainDialog(config.base.dom.method[temp.mode].title, download.generateDOM(), config.base.dom.method[temp.mode].footer);
},
async getFilesUrl(items, token) {
if (base.isType(items) !== "array") return [];
@@ -6644,7 +6754,7 @@ button.downloadSubtitle:disabled {
if (res.code) {
batch.forEach(item => item.dlink = `获取下载地址失败,服务器说:${res.code},刷新后再试试吧~`);
} else {
- throw new Error("提示:
获取下载链接失败,刷新网页后再试试吧~");
+ throw new Error("提示:
获取下载地址失败,刷新网页后再试试吧~");
}
};
@@ -6654,7 +6764,7 @@ button.downloadSubtitle:disabled {
});
proc++;
- $doc.find(".swal2-html-container").html(`已获取 ${proc} / ${pending.length} 个链接`);
+ $doc.find(".swal2-html-container").html(`已获取 ${proc} / ${pending.length} 个地址`);
}));
// 批次间休息
@@ -6672,7 +6782,7 @@ button.downloadSubtitle:disabled {
if (props) {
const fileList = props.dataSource || [];
const selectedKeys = props.selectedKeys.split(",");
- fileList.forEach(function (val) {
+ fileList.forEach(val => {
if (selectedKeys.includes(val.fileId)) {
list.push(val);
}
@@ -6680,7 +6790,7 @@ button.downloadSubtitle:disabled {
}
return base.clone(list);
} catch (e) {
- console.error(e);
+ base.console.error(e);
return [];
}
},
@@ -6708,158 +6818,38 @@ button.downloadSubtitle:disabled {
*/
const $mcloud = {
addPageListener() {
- $doc.on("click", ".pl-button-save", async function (e) {
+ $doc.on("click", ".pl-button-save", async (e) => {
e.preventDefault();
const selections = temp.main.getSelectedList();
- if (selections.length === 0) return message.error("提示:
请勾选要下载的文件哦~");
+ if (selections.length === 0) return message.error("提示:
请先勾选要下载的文件哦~");
if (selections.every(item => !item.contentID && !item.contentName)) return message.error("提示:
请打开文件夹后再勾选文件~");
message.info("提示:
因网盘限制,只能够通过页面直接下载哦~");
await base.sleep(500);
document.querySelector(".btn-top.btn-top_dl").click();
});
- $doc.on("click", ".listener-api-download.enhance", async function (e) {
- e.preventDefault();
- const status = base._EventFactory(e);
- const file = {
- index: status.item.data("index"),
- link: status.item.data("link"),
- name: status.item.data("name"),
- size: status.item.data("size") || 0,
- }
- base._resetData(file.index);
-
- // UI 初始化
- status.down_normal.hide();
- status.down_enhance.hide();
- status.down_idm.hide();
- status.link_message.hide();
- status.link_copy.hide();
-
- status.down_enhance_downing.find(".stop").show();
- status.down_enhance_downing.show();
-
- base.download(file.link, undefined, {
- ...file,
- onProgress: (data) => {
- const dprog = Math.min(data.progress, 100);
- status.down_enhance_downing.find(".pl-progress").css("--width", `${dprog}%`);
- status.down_enhance_downing.find(".pl-progress .text").text(`${dprog.toFixed(2)}% | 已存:${base.sizeFormat(data.loaded)} | 速度:${data.speedText} | 剩余:${data.etaText}`);
- }
- })
- .then(async (res) => {
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#55af28");
- base.blobDownload(res.response, file.name);
- await base.sleep(1000);
-
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress .text").html(`下载完成~ 浏览器下载框应该弹出来了哦~`);
- })
- .catch(async (error) => {
- base.console.error("【LinkSwift】Download(load)", error);
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress").css("--width", "100%");
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#cc3235");
- let estatus = `QAQ 下载出错~`;
- if (!error?.status) estatus += ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
- if (error?.status == 403) estatus += ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
- if (error?.status == 204 || error?.statusText === "IDM") estatus += ` 服务说:链接已被 IDM 捕获~`;
- status.down_enhance_downing.find(".pl-progress .text").html(estatus);
- status.down_enhance_downing.find(".pl-progress .text").css("white-space", "break-spaces");
- })
- });
- $doc.on("click", ".listener-idm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToIDM(target.data("link"), target.data("filename"), target.data("filesize"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-aria2-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToAria2(target.data("link"), target.data("filename"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-bitcomet-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-abdm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToABDM(target.data("link"), target.data("filename"), undefined);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
},
greenerPage() {
- base.waitForKeyElements(".adv_swiper_menu", function (tag) {
+ base.waitForKeyElements(".adv_swiper_menu", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".client-bubble", function (tag) {
+ base.waitForKeyElements(".client-bubble", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".avs-box", function (tag) {
+ base.waitForKeyElements(".avs-box", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".top-adv-swiper", function (tag) {
+ base.waitForKeyElements(".top-adv-swiper", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".client_download_icon", function (tag) {
+ base.waitForKeyElements(".client_download_icon", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".document_top_memberCenter", function (tag) {
- $(tag[0]).click(function () {
+ base.waitForKeyElements(".document_top_memberCenter", (tag) => {
+ $(tag[0]).click(() => {
Swal.fire({
...temp.swalDefault,
html: `
`,
- didOpen: function (toast) {
+ didOpen(toast) {
const iframe = toast.querySelector('iframe');
const updateHeight = () => {
iframe.style.height = (window.innerHeight - 100) + 'px';
@@ -6868,7 +6858,7 @@ button.downloadSubtitle:disabled {
window.addEventListener('resize', updateHeight);
toast._resizeHandler = updateHeight;
},
- willClose: function (toast) {
+ willClose(toast) {
// 清理事件监听器
window.removeEventListener('resize', toast._resizeHandler);
},
@@ -6896,32 +6886,32 @@ button.downloadSubtitle:disabled {
const $button = $(`
下载助手
`);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$mcloud.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "share") return;
const $button = $(`
下载助手
`);
element.prepend($button);
- })
+ });
},
addInitButton() {
const $button = $(`
点我点亮
`);
@@ -6931,13 +6921,13 @@ button.downloadSubtitle:disabled {
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "home") return;
$button.addClass("mcloud-button");
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$mcloud.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "share") return;
$button.addClass("mcloud-share-button").css({ "cursor": "pointer" });
element.prepend($button);
- })
+ });
},
getRandomString(len) {
len = len || 16;
@@ -6951,7 +6941,7 @@ button.downloadSubtitle:disabled {
},
utob(str) {
const u = String.fromCharCode;
- return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, function (t) {
+ return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, (t) => {
if (t.length < 2) {
const e = t.charCodeAt(0);
return e < 128 ? t : e < 2048 ? u(192 | e >>> 6) + u(128 | 63 & e) : u(224 | e >>> 12 & 15) + u(128 | e >>> 6 & 63) + u(128 | 63 & e);
@@ -7040,14 +7030,14 @@ button.downloadSubtitle:disabled {
},
async getLink() {
let selects = this.getSelectedList();
- if (selects.length === 0) throw new Error("提示:
请勾选要下载的文件哦~");
+ if (selects.length === 0) throw new Error("提示:
请先勾选要下载的文件哦~");
if (selects.every(item => !item.contentID && !item.contentName)) throw new Error("提示:
请打开文件夹后再勾选文件~");
if (temp.page === "home") {
selects = selects.filter(item => item.contentID && item.contentName && item.contentSuffix);
const batchSize = 15;
let proc = 0;
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
for (let i = 0; i < selects.length; i += batchSize) {
const batch = selects.slice(i, i + batchSize);
const queue = [];
@@ -7056,13 +7046,13 @@ button.downloadSubtitle:disabled {
queue.push(this.getFileUrl(item, globalIndex)
.then(val => {
proc++;
- $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个链接~
`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个地址~
`);
return val;
}));
});
const res = await Promise.all(queue).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[中国移动云盘] 获取文件 URL 失败");
+ throw new Error(e?.message || e || "[中国移动云盘] 获取下载地址失败");
});
res.forEach(val => (selects[val.index].downloadUrl = val.downloadUrl));
await base.sleep(1000);
@@ -7070,20 +7060,33 @@ button.downloadSubtitle:disabled {
} else {
throw new Error("提示:
页面错误~");
}
- temp.links = [selects, {
- isFolder: v => (v.dirEtag || v.caName),
- getFileName: v => (v.contentName || v.coName),
- getFileSize: v => (v.contentSize || v.coSize),
- getFileLink: v => v.downloadUrl,
- tooltip: config.$mcloud.dom
+ temp.files = [selects, {
+ get: {
+ dir: v => (v.dirEtag || v.caName),
+ name: v => (v.contentName || v.coName),
+ size: v => (v.contentSize || v.coSize),
+ link: v => v.downloadUrl,
+ },
+ headers: {},
+ convert: {},
+ dom: {
+ tooltip: config.$mcloud.dom,
+ download: {
+ error: (error) => {
+ if (!error?.status) return ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
+ if (error?.status == 403) return ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
+ if (error?.status == 204 || error?.statusText === "IDM") return ` 服务说:链接已被 IDM 捕获~`;
+ }
+ }
+ }
}];
- base.showMainDialog(config.base.dom.button[temp.mode].title, base.generateDOM(temp.links), config.base.dom.button[temp.mode].footer);
+ base.showMainDialog(config.base.dom.method[temp.mode].title, download.generateDOM(), config.base.dom.method[temp.mode].footer);
},
getSelectedList() {
try {
- return document.querySelector(".main_file_list").__vue__.selects.map(val => val.item);
+ return document.querySelector(".main_file_list").__vue__.selectList.map(val => val.item);
} catch {
- const vueDom = document.querySelector(".home-page").__vue__;
+ const vueDom = document.querySelector(".home-page")?.__vue__;
const fileList = vueDom._computedWatchers.fileList.value;
const dirList = vueDom._computedWatchers.dirList.value;
const selectedFileIndex = vueDom.selectedFile;
@@ -7120,133 +7123,11 @@ button.downloadSubtitle:disabled {
* @author hmjz100
*/
const $tcloud = {
- addPageListener() {
- $doc.on("click", ".listener-api-download.enhance", async function (e) {
- e.preventDefault();
- const status = base._EventFactory(e);
- const file = {
- index: status.item.data("index"),
- link: status.item.data("link"),
- name: status.item.data("name"),
- size: status.item.data("size") || 0,
- }
- base._resetData(file.index);
-
- // UI 初始化
- status.down_normal.hide();
- status.down_enhance.hide();
- status.down_idm.hide();
- status.link_message.hide();
- status.link_copy.hide();
-
- status.down_enhance_downing.find(".stop").show();
- status.down_enhance_downing.show();
-
- base.download(file.link, undefined, {
- ...file,
- onProgress: (data) => {
- const dprog = Math.min(data.progress, 100);
- status.down_enhance_downing.find(".pl-progress").css("--width", `${dprog}%`);
- status.down_enhance_downing.find(".pl-progress .text").text(`${dprog.toFixed(2)}% | 已存:${base.sizeFormat(data.loaded)} | 速度:${data.speedText} | 剩余:${data.etaText}`);
- }
- })
- .then(async (res) => {
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#55af28");
- base.blobDownload(res.response, file.name);
- await base.sleep(1000);
-
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress .text").html(`下载完成~ 浏览器下载框应该弹出来了哦~`);
- })
- .catch(async (error) => {
- base.console.error("【LinkSwift】Download(load)", error);
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress").css("--width", "100%");
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#cc3235");
- let estatus = `QAQ 下载出错~`;
- if (!error?.status) estatus += ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
- if (error?.status == 403) estatus += ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
- if (error?.status == 204 || error?.statusText === "IDM") estatus += ` 服务说:链接已被 IDM 捕获~`;
- status.down_enhance_downing.find(".pl-progress .text").html(estatus);
- status.down_enhance_downing.find(".pl-progress .text").css("white-space", "break-spaces");
- })
- });
- $doc.on("click", ".listener-idm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToIDM(target.data("link"), target.data("filename"), target.data("filesize"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-aria2-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToAria2(target.data("link"), target.data("filename"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-bitcomet-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-abdm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToABDM(target.data("link"), target.data("filename"), undefined);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- },
greenerPage() {
- base.waitForKeyElements(".advertising-mask", function (tag) {
+ base.waitForKeyElements(".advertising-mask", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements("a.client-download.nav-block", function (tag) {
+ base.waitForKeyElements("a.client-download.nav-block", (tag) => {
tag.fadeOut();
}, true);
},
@@ -7275,30 +7156,30 @@ button.downloadSubtitle:disabled {
`);
- $button.find(".pl-dropdown-menu").css({ "position": "absolute", "left": "-1px" })
+ $button.find(".pl-dropdown-menu").css({ "position": "absolute", "left": "-1px" });
base.waitForKeyElements(config.$tcloud.mount.home, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "home") return;
- $button.find(".pl-dropdown-menu").css({ "top": "28px" })
+ $button.find(".pl-dropdown-menu").css({ "top": "28px" });
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$tcloud.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "share") return;
- $button.css({ "height": "28px", "border-radius": "15px" })
- $button.find(".pl-dropdown-menu").css({ "top": "25px" })
+ $button.css({ "height": "28px", "border-radius": "15px" });
+ $button.find(".pl-dropdown-menu").css({ "top": "25px" });
element.prepend($button);
- })
+ });
},
addInitButton() {
const $button = $(`
点我点亮
`);
@@ -7307,13 +7188,13 @@ button.downloadSubtitle:disabled {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "home") return;
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$tcloud.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "share") return;
- $button.css({ "height": "28px", "border-radius": "15px" })
+ $button.css({ "height": "28px", "border-radius": "15px" });
element.prepend($button);
- })
+ });
},
async getToken() {
$doc.find(".loading-popup .loading-title").html(`令牌获取中`);
@@ -7359,7 +7240,7 @@ button.downloadSubtitle:disabled {
},
async getLink() {
let selects = this.getSelectedList();
- if (selects.length === 0) throw new Error("提示:
请勾选要下载的文件哦~");
+ if (selects.length === 0) throw new Error("提示:
请先勾选要下载的文件哦~");
if (selects.every(item => item.isFolder)) throw new Error("提示:
请打开文件夹后再勾选文件~");
selects = selects.filter(item => !item.isFolder)
$doc.find(".loading-popup .loading-title").html(`令牌获取中`);
@@ -7375,8 +7256,8 @@ button.downloadSubtitle:disabled {
$doc.find(".loading-popup .swal2-html-container").html(`
获取缓存成功~
`);
const batchSize = 15;
let proc = 0;
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
for (let i = 0; i < selects.length; i += batchSize) {
const batch = selects.slice(i, i + batchSize);
const queue = [];
@@ -7385,27 +7266,40 @@ button.downloadSubtitle:disabled {
queue.push(this.getFileUrl(item, globalIndex, token)
.then(val => {
proc++;
- $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个链接~
`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个地址~
`);
return val;
}));
});
const res = await Promise.all(queue).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[天翼云盘] 获取文件 URL 失败");
+ throw new Error(e?.message || e || "[天翼云盘] 获取下载地址失败");
});
res.forEach(val => {
selects[val.index].downloadUrl = val.downloadUrl;
});
await base.sleep(1000);
}
- temp.links = [selects, {
- isFolder: v => v.isFolder,
- getFileName: v => v.fileName,
- getFileSize: v => v.size,
- getFileLink: v => v.downloadUrl,
- tooltip: config.$mcloud.dom
+ temp.files = [selects, {
+ get: {
+ dir: v => v.isFolder,
+ name: v => v.fileName,
+ size: v => v.size,
+ link: v => v.downloadUrl,
+ },
+ headers: {},
+ convert: {},
+ dom: {
+ tooltip: config.$mcloud.dom,
+ download: {
+ error: (error) => {
+ if (!error?.status) return ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
+ if (error?.status == 403) return ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
+ if (error?.status == 204 || error?.statusText === "IDM") return ` 服务说:链接已被 IDM 捕获~`;
+ }
+ }
+ }
}];
- base.showMainDialog(config.base.dom.button[temp.mode].title, base.generateDOM(temp.links), config.base.dom.button[temp.mode].footer);
+ base.showMainDialog(config.base.dom.method[temp.mode].title, download.generateDOM(), config.base.dom.method[temp.mode].footer);
},
getSelectedList() {
try {
@@ -7427,7 +7321,6 @@ button.downloadSubtitle:disabled {
} else {
this.addInitButton();
}
- this.addPageListener();
this.getToken();
},
};
@@ -7439,7 +7332,7 @@ button.downloadSubtitle:disabled {
*/
const $xunlei = {
addPageListener() {
- $doc.on("click", ".pl-button-save", async function (e) {
+ $doc.on("click", ".pl-button-save", async (e) => {
e.preventDefault();
const selections = temp.main.getSelectedList();
if (selections.length === 0) {
@@ -7449,126 +7342,6 @@ button.downloadSubtitle:disabled {
await base.sleep(500);
document.querySelector(".saveToCloud").click();
});
- $doc.on("click", ".listener-api-download.enhance", async function (e) {
- e.preventDefault();
- const status = base._EventFactory(e);
- const file = {
- index: status.item.data("index"),
- link: status.item.data("link"),
- name: status.item.data("name"),
- size: status.item.data("size") || 0,
- }
- base._resetData(file.index);
-
- // UI 初始化
- status.down_normal.hide();
- status.down_enhance.hide();
- status.down_idm.hide();
- status.link_message.hide();
- status.link_copy.hide();
-
- status.down_enhance_downing.find(".stop").show();
- status.down_enhance_downing.show();
-
- base.download(file.link, undefined, {
- ...file,
- onProgress: (data) => {
- const dprog = Math.min(data.progress, 100);
- status.down_enhance_downing.find(".pl-progress").css("--width", `${dprog}%`);
- status.down_enhance_downing.find(".pl-progress .text").text(`${dprog.toFixed(2)}% | 已存:${base.sizeFormat(data.loaded)} | 速度:${data.speedText} | 剩余:${data.etaText}`);
- }
- })
- .then(async (res) => {
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#55af28");
- base.blobDownload(res.response, file.name);
- await base.sleep(1000);
-
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress .text").html(`下载完成~ 浏览器下载框应该弹出来了哦~`);
- })
- .catch(async (error) => {
- base.console.error("【LinkSwift】Download(load)", error);
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress").css("--width", "100%");
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#cc3235");
- let estatus = `QAQ 下载出错~`;
- if (!error?.status) estatus += ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
- if (error?.status == 403) estatus += ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
- if (error?.status == 204 || error?.statusText === "IDM") estatus += ` 服务说:链接已被 IDM 捕获~`;
- status.down_enhance_downing.find(".pl-progress .text").html(estatus);
- status.down_enhance_downing.find(".pl-progress .text").css("white-space", "break-spaces");
- })
- });
- $doc.on("click", ".listener-idm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToIDM(target.data("link"), target.data("filename"), target.data("filesize"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-aria2-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToAria2(target.data("link"), target.data("filename"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-bitcomet-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"), { "mirror_url_list": base.getMirrorList(target.data("link"), config.$xunlei.api.mirror), "checkboxCustomHeadersForMirrors": "on" });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-abdm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToABDM(target.data("link"), target.data("filename"), undefined);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
},
beautifyPage() {
if (base.getValue("setting_ui_theme").custom.$xunlei !== true) return;
@@ -7592,48 +7365,48 @@ button.downloadSubtitle:disabled {
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "home") return;
const $button = $(`
下载助手
`);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$xunlei.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "share") return;
- const $button = $(`
- 下载助手
-
`);
- $button.css({ "margin-right": "10px" });
- element.prepend($button);
- })
+ `);
+ element.append($button);
+ });
},
addInitButton() {
- const $button = $(`
点我点亮
`);
- $button.click(base.showInitDialog);
base.waitForKeyElements(config.$xunlei.mount.home, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "home") return;
+ const $button = $(`
点我点亮
`);
+ $button.click(base.showInitDialog);
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$xunlei.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "share") return;
- $button.css({ "margin-right": "10px" });
- element.prepend($button);
- })
+ const $button = $(`
点我点亮`);
+ $button.click(base.showInitDialog);
+ element.append($button);
+ });
},
_getCaptchaSign(clientId, version, host, deviceId, timestamp) {
// 基础参数
@@ -7667,58 +7440,122 @@ button.downloadSubtitle:disabled {
$doc.find(".loading-popup .loading-title").html(`令牌获取中`);
$doc.find(".loading-popup .swal2-html-container").html(`
获取状态中~
`);
}
- let creds = {}, cap = {}, userId = "", clientId = "", capKey = "";
+
+ let creds = {}, cap = {};
+ let userId = "", clientId = "", credsKey = "", capKey = "";
const clientVersion = "1.92.62";
- const timestamp = Math.floor(Date.now());
- const deviceId = /(\w{32})/.exec((base.getStorage("deviceid") || "")?.split?.(",")?.[0])?.[0] || ""; // 设备 ID
+ const timestamp = Date.now();
+
+ // 提取信息
+ const rawDeviceId = base.getStorage("deviceid") || "";
+ const deviceId = /(\w{32})/.exec(rawDeviceId?.split?.(",")?.[0])?.[0] || ""; // 32 位设备 ID
- // 凭证
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);
const val = base.getStorage(key);
if (key.startsWith("credentials_")) {
- creds = val;
- userId = val?.user_id || "";
+ creds = val || {};
+ userId = creds?.user_id || "";
clientId = key.split("_")[1];
+ credsKey = key;
capKey = `captcha_${clientId}`;
} else if (key.startsWith("captcha_")) {
- cap = val;
- clientId = key.split("_")[1];
- capKey = `captcha_${clientId}`;
- }
- }
-
- // 校验并刷新
- const isExpired = force || !cap?.token || Date.now() >= new Date(cap.expires_at).getTime();
- if (isExpired && clientId && deviceId) {
- $doc.find(".loading-popup .swal2-html-container").html(`
令牌过期,正在获取新令牌~
`);
-
- const res = await base.post(config.$xunlei.api.getCaptchaToken, {
- client_id: clientId,
- action: "get:/drive/v1/about",
- device_id: deviceId,
- meta: {
- username: "", phone_number: "", email: "",
- package_name: location.host,
- client_version: clientVersion,
- captcha_sign: this._getCaptchaSign(clientId, clientVersion, location.host, deviceId, timestamp.toString()),
- timestamp: timestamp.toString(),
- user_id: userId
+ cap = val || {};
+ if (!clientId) {
+ clientId = key.split("_")[1];
+ capKey = key;
+ credsKey = `credentials_${clientId}`;
}
- }, { "Content-Type": "application/json" });
-
- if (res?.captcha_token) {
- cap = { token: res.captcha_token, expires_at: new Date(timestamp + res.expires_in * 1000).toString() };
- base.setStorage(capKey, cap);
- } else {
- throw new Error(`错误:
令牌刷新失败,${res?.error_description || res?.error || "未知错误"}`);
}
- } else if (!creds || !cap || !clientId || !deviceId) {
- throw new Error(`错误:
请先登录网盘后再获取文件呢~`);
}
+ // 基本校验,无客户端 ID 或设备 ID 直接抛错
+ if (!clientId || !deviceId) throw new Error(`错误:
请先登录网盘后再获取文件呢~`);
+
+ // 检查并刷新 Credentials
+ const credsExpiresAt = creds?.expires_at ? new Date(creds.expires_at).getTime() : 0;
+ // 提前 60 秒算作过期,防止临界点请求失效
+ const isCredsExpired = force || !creds?.access_token || Date.now() >= (credsExpiresAt - 60000);
+
+ if (isCredsExpired) {
+ if (!creds?.refresh_token) throw new Error(`错误:
登录凭证已过期,且未检测到刷新令牌,请重新登录网盘~`);
+
+ $doc.find(".loading-popup .swal2-html-container").html(`
登录凭证过期,正在获取新凭证~
`);
+
+ try {
+ const credsRes = await base.post(config.$xunlei.api.getAccessToken, {
+ client_id: clientId,
+ grant_type: "refresh_token",
+ refresh_token: creds.refresh_token
+ }, {
+ "Content-Type": "application/json",
+ "x-action": "401",
+ "x-client-id": clientId,
+ "x-device-id": rawDeviceId,
+ "x-device-sign": deviceId,
+ "x-protocol-version": "301",
+ "x-sdk-version": "3.4.20"
+ });
+
+ if (credsRes?.access_token) {
+ creds = {
+ ...creds,
+ ...credsRes,
+ expires_at: new Date(timestamp + (credsRes.expires_in || 43200) * 1000).toISOString()
+ };
+ userId = creds.user_id || userId;
+ base.setStorage(credsKey, creds);
+ } else {
+ throw new Error(credsRes?.error_description || credsRes?.error || "未知错误");
+ }
+ } catch (e) {
+ throw new Error(`错误:
身份凭证刷新失败:${e.message || e}`, { cause: e });
+ }
+ }
+
+ // 检查并刷新 Captcha
+ const capExpiresAt = cap?.expires_at ? new Date(cap.expires_at).getTime() : 0;
+ const isCapExpired = force || !cap?.token || Date.now() >= (capExpiresAt - 60000);
+
+ if (isCapExpired) {
+ $doc.find(".loading-popup .swal2-html-container").html(`
验证令牌过期,正在获取新令牌~
`);
+
+ try {
+ const capRes = await base.post(config.$xunlei.api.getCaptchaToken, {
+ client_id: clientId,
+ action: "get:/drive/v1/about",
+ device_id: deviceId,
+ meta: {
+ username: "",
+ phone_number: "",
+ email: "",
+ package_name: location.host,
+ client_version: clientVersion,
+ captcha_sign: this._getCaptchaSign(clientId, clientVersion, location.host, deviceId, timestamp.toString()),
+ timestamp: timestamp.toString(),
+ user_id: userId
+ }
+ }, { "Content-Type": "application/json" });
+
+ if (capRes?.captcha_token) {
+ cap = {
+ token: capRes.captcha_token,
+ expires_at: new Date(timestamp + capRes.expires_in * 1000).toString()
+ };
+ base.setStorage(capKey, cap);
+ } else {
+ throw new Error(capRes?.error_description || capRes?.error || "未知错误");
+ }
+ } catch (e) {
+ throw new Error(`错误:
验证令牌刷新失败:${e.message || e}`, { cause: e });
+ }
+ }
+
+ // 终极校验
+ if (!creds?.access_token || !cap?.token) throw new Error(`错误:
获取令牌失败,请重新登录网盘~`);
+
return { credentials: creds, captcha: cap, device_id: deviceId };
});
},
@@ -7759,13 +7596,13 @@ button.downloadSubtitle:disabled {
},
async getLink() {
const selects = this.getSelectedList();
- if (selects.length === 0) throw new Error("提示:
请勾选要下载的文件哦~");
+ if (selects.length === 0) throw new Error("提示:
请先勾选要下载的文件哦~");
if (selects.every(item => item.kind !== "drive#file")) throw new Error("提示:
请打开文件夹后再勾选文件~");
if (temp.page === "home") {
const batchSize = 15;
let proc = 0;
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
for (let i = 0; i < selects.length; i += batchSize) {
const batch = selects.slice(i, i + batchSize);
const queue = [];
@@ -7774,13 +7611,13 @@ button.downloadSubtitle:disabled {
queue.push(this.getFileUrl(item, globalIndex)
.then(val => {
proc++;
- $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个链接~
`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个地址~
`);
return val;
}));
});
const res = await Promise.all(queue).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[迅雷云盘] 获取文件 URL 失败");
+ throw new Error(e?.message || e || "[迅雷云盘] 获取下载地址失败");
});
res.forEach(val => {
selects[val.index].downloadUrl = val.downloadUrl;
@@ -7790,15 +7627,28 @@ button.downloadSubtitle:disabled {
} else {
throw new Error("提示:
页面错误~");
}
- temp.links = [selects, {
- isFolder: v => v.kind === "drive#folder",
- getFileName: v => v.name,
- getFileSize: v => v.size,
- getFileLink: v => v.downloadUrl,
- getFileMirror: v => base.getMirrorList(v, config.$xunlei.api.mirror),
- tooltip: config.$xunlei.dom
+ temp.files = [selects, {
+ get: {
+ dir: v => v.kind === "drive#folder",
+ name: v => v.name,
+ size: v => v.size,
+ link: v => v.downloadUrl,
+ morror: v => base.getMirrorList(v, config.$xunlei.api.mirror),
+ },
+ headers: {},
+ convert: {},
+ dom: {
+ tooltip: config.$xunlei.dom,
+ download: {
+ error: (error) => {
+ if (!error?.status) return ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
+ if (error?.status == 403) return ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
+ if (error?.status == 204 || error?.statusText === "IDM") return ` 服务说:链接已被 IDM 捕获~`;
+ }
+ }
+ }
}];
- base.showMainDialog(config.base.dom.button[temp.mode].title, base.generateDOM(temp.links), config.base.dom.button[temp.mode].footer);
+ base.showMainDialog(config.base.dom.method[temp.mode].title, download.generateDOM(), config.base.dom.method[temp.mode].footer);
},
getSelectedList() {
try {
@@ -7839,126 +7689,6 @@ button.downloadSubtitle:disabled {
if (e instanceof Error) throw e;
throw new Error(e?.message || e || "[光鸭云盘] 获取分享令牌失败");
});
- $doc.on("click", ".listener-api-download.enhance", async function (e) {
- e.preventDefault();
- const status = base._EventFactory(e);
- const file = {
- index: status.item.data("index"),
- link: status.item.data("link"),
- name: status.item.data("name"),
- size: status.item.data("size") || 0,
- }
- base._resetData(file.index);
-
- // UI 初始化
- status.down_normal.hide();
- status.down_enhance.hide();
- status.down_idm.hide();
- status.link_message.hide();
- status.link_copy.hide();
-
- status.down_enhance_downing.find(".stop").show();
- status.down_enhance_downing.show();
-
- base.download(file.link, undefined, {
- ...file,
- onProgress: (data) => {
- const dprog = Math.min(data.progress, 100);
- status.down_enhance_downing.find(".pl-progress").css("--width", `${dprog}%`);
- status.down_enhance_downing.find(".pl-progress .text").text(`${dprog.toFixed(2)}% | 已存:${base.sizeFormat(data.loaded)} | 速度:${data.speedText} | 剩余:${data.etaText}`);
- }
- })
- .then(async (res) => {
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#55af28");
- base.blobDownload(res.response, file.name);
- await base.sleep(1000);
-
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress .text").html(`下载完成~ 浏览器下载框应该弹出来了哦~`);
- })
- .catch(async (error) => {
- base.console.error("【LinkSwift】Download(load)", error);
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress").css("--width", "100%");
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#cc3235");
- let estatus = `QAQ 下载出错~`;
- if (!error?.status) estatus += ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
- if (error?.status == 403) estatus += ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
- if (error?.status == 204 || error?.statusText === "IDM") estatus += ` 服务说:链接已被 IDM 捕获~`;
- status.down_enhance_downing.find(".pl-progress .text").html(estatus);
- status.down_enhance_downing.find(".pl-progress .text").css("white-space", "break-spaces");
- })
- });
- $doc.on("click", ".listener-idm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToIDM(target.data("link"), target.data("filename"), target.data("filesize"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-aria2-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToAria2(target.data("link"), target.data("filename"));
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-bitcomet-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"), { "checkboxCustomHeadersForMirrors": "on" });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-abdm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToABDM(target.data("link"), target.data("filename"), undefined);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
},
beautifyPage() {
if (base.getValue("setting_ui_theme").custom.$guangya !== true) return;
@@ -7974,14 +7704,14 @@ button.downloadSubtitle:disabled {
addButton() {
const $button = $(`
${this.svg}下载助手
`);
base.waitForKeyElements(config.$guangya.mount.home, (element) => {
@@ -7990,15 +7720,15 @@ button.downloadSubtitle:disabled {
$button.addClass([...document.querySelector(`[class*="ant-btn css-"]`).className.match(/css-[a-z0-9]+ css-var-[a-z0-9_]+/g) || []].join(' '));
$button.find(".pl-dropdown-menu").css({ "top": "34px" });
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$guangya.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button").length > 0 || !temp.page || temp.page !== "share") return;
$button.addClass([...document.querySelector(`[class*="ant-btn css-"]`).className.match(/css-[a-z0-9]+ css-var-[a-z0-9_]+/g) || []].join(' '));
$button.addClass("ant-btn-lg");
- $button.find(".pl-dropdown-menu").css({ "bottom": "46px" });
+ $button.find(".pl-dropdown-menu").addClass("reverse").css({ "bottom": "46px" });
element.append($button);
- })
+ });
},
addInitButton() {
const $button = $(`
${this.svg}点我点亮`);
@@ -8009,7 +7739,7 @@ button.downloadSubtitle:disabled {
$button.addClass([...document.querySelector(`[class*="ant-btn css-"]`).className.match(/css-[a-z0-9]+ css-var-[a-z0-9_]+/g) || []].join(' '));
$button.find(".pl-dropdown-menu").css({ "top": "34px" });
element.prepend($button);
- })
+ });
base.waitForKeyElements(config.$guangya.mount.share, (element) => {
temp.page = temp.main.detectPage();
if ($(".pl-button-init").length > 0 || !temp.page || temp.page !== "share") return;
@@ -8017,7 +7747,7 @@ button.downloadSubtitle:disabled {
$button.addClass("ant-btn-lg");
$button.find(".pl-dropdown-menu").css({ "bottom": "46px" });
element.append($button);
- })
+ });
},
getToken() {
$doc.find(".loading-popup .loading-title").html(`令牌获取中`);
@@ -8095,14 +7825,14 @@ button.downloadSubtitle:disabled {
},
async getLink() {
const selects = this.getSelectedList();
- if (selects.length === 0) throw new Error("提示:
请勾选要下载的文件哦~");
+ if (selects.length === 0) throw new Error("提示:
请先勾选要下载的文件哦~");
if (selects.every(item => item.resType == 2)) throw new Error("提示:
请打开文件夹后再勾选文件~");
if (temp.page === "home") {
const token = this.getToken();
const batchSize = 15;
let proc = 0;
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
for (let i = 0; i < selects.length; i += batchSize) {
const batch = selects.slice(i, i + batchSize);
const queue = [];
@@ -8111,13 +7841,13 @@ button.downloadSubtitle:disabled {
queue.push(this.getFileUrl(item, globalIndex, token)
.then(val => {
proc++;
- $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个链接~
`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个地址~
`);
return val;
}));
});
const res = await Promise.all(queue).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[光鸭云盘] 获取文件下载 URL 失败");
+ throw new Error(e?.message || e || "[光鸭云盘] 获取文件下载地址失败");
});
res.forEach(val => {
selects[val.index].downloadUrl = val.downloadUrl;
@@ -8132,8 +7862,8 @@ button.downloadSubtitle:disabled {
});
const batchSize = 15;
let proc = 0;
- $doc.find(".loading-popup .loading-title").html(`链接获取中`);
- $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载链接~
`);
+ $doc.find(".loading-popup .loading-title").html(`地址获取中`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
正在获取文件对应的下载地址~
`);
for (let i = 0; i < selects.length; i += batchSize) {
const batch = selects.slice(i, i + batchSize);
const queue = [];
@@ -8142,13 +7872,13 @@ button.downloadSubtitle:disabled {
queue.push(this.getFileUrl(item, globalIndex, token, shareToken)
.then(val => {
proc++;
- $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个链接~
`);
+ $doc.find(".loading-popup .swal2-html-container").html(`
已获取 ${proc} / ${selects.length} 个地址~
`);
return val;
}));
});
const res = await Promise.all(queue).catch(e => {
if (e instanceof Error) throw e;
- throw new Error(e?.message || e || "[光鸭云盘] 获取文件下载 URL 失败");
+ throw new Error(e?.message || e || "[光鸭云盘] 获取文件下载地址失败");
});
res.forEach(val => {
selects[val.index].downloadUrl = val.downloadUrl;
@@ -8158,14 +7888,27 @@ button.downloadSubtitle:disabled {
} else {
throw new Error("提示:
页面错误~");
}
- temp.links = [selects, {
- isFolder: v => v.resType == 2,
- getFileName: v => v.fileName,
- getFileSize: v => v.fileSize,
- getFileLink: v => v.downloadUrl,
- tooltip: config.$guangya.dom
+ temp.files = [selects, {
+ get: {
+ dir: v => v.resType == 2,
+ name: v => v.fileName,
+ size: v => v.fileSize,
+ link: v => v.downloadUrl,
+ },
+ headers: {},
+ convert: {},
+ dom: {
+ tooltip: config.$guangya.dom,
+ download: {
+ error: (error) => {
+ if (!error?.status) return ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
+ if (error?.status == 403) return ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
+ if (error?.status == 204 || error?.statusText === "IDM") return ` 服务说:链接已被 IDM 捕获~`;
+ }
+ }
+ }
}];
- base.showMainDialog(config.base.dom.button[temp.mode].title, base.generateDOM(temp.links), config.base.dom.button[temp.mode].footer);
+ base.showMainDialog(config.base.dom.method[temp.mode].title, download.generateDOM(), config.base.dom.method[temp.mode].footer);
},
getSelectedList() {
try {
@@ -8176,10 +7919,8 @@ button.downloadSubtitle:disabled {
if (props) {
const fileList = props.dataSource || [];
const selectedKeys = props.selectedItems || [];
- fileList.forEach(function (val) {
- if (selectedKeys.includes(val.fileId)) {
- selectedList.push({ ...val });
- }
+ fileList.forEach(val => {
+ if (selectedKeys.includes(val.fileId)) selectedList.push({ ...val });
});
}
return selectedList;
@@ -8211,7 +7952,7 @@ button.downloadSubtitle:disabled {
*/
const $quark = {
addPageListener() {
- $doc.on("click", ".pl-button-save", async function (e) {
+ $doc.on("click", ".pl-button-save", async (e) => {
e.preventDefault();
const selections = temp.main.getSelectedList();
if (selections.length === 0) {
@@ -8224,172 +7965,51 @@ button.downloadSubtitle:disabled {
element.one("click", async () => {
await base.sleep(1000);
document.querySelector(".share-save").click();
- })
+ });
return true;
}, true)
});
- $doc.on("click", ".listener-api-download.enhance", async function (e) {
- e.preventDefault();
- const status = base._EventFactory(e);
- const file = {
- index: status.item.data("index"),
- link: status.item.data("link"),
- name: status.item.data("name"),
- size: status.item.data("size") || 0,
- }
- base._resetData(file.index);
-
- // UI 初始化
- status.down_normal.hide();
- status.down_enhance.hide();
- status.down_idm.hide();
- status.link_message.hide();
- status.link_copy.hide();
-
- status.down_enhance_downing.find(".stop").show();
- status.down_enhance_downing.show();
-
- base.download(file.link, { "User-Agent": config.$quark.api.ua.downloadLink }, {
- ...file,
- onProgress: (data) => {
- const dprog = Math.min(data.progress, 100);
- status.down_enhance_downing.find(".pl-progress").css("--width", `${dprog}%`);
- status.down_enhance_downing.find(".pl-progress .text").text(`${dprog.toFixed(2)}% | 已存:${base.sizeFormat(data.loaded)} | 速度:${data.speedText} | 剩余:${data.etaText}`);
- }
- })
- .then(async (res) => {
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#55af28");
- base.blobDownload(res.response, file.name);
- await base.sleep(1000);
-
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress .text").html(`下载完成~ 浏览器下载框应该弹出来了哦~`);
- })
- .catch(async (error) => {
- base.console.error("【LinkSwift】Download(load)", error);
- status.down_enhance_downing.find(".stop").hide();
- status.down_enhance_downing.find(".back").show();
- status.down_enhance_downing.find(".pl-progress").css("--width", "100%");
- status.down_enhance_downing.find(".pl-progress .head").css("background", "#cc3235");
- let estatus = `QAQ 下载出错~`;
- if (!error?.status) estatus += ` 服务器未返回状态,若是下载一段时间后中断,可能是服务器返回文件长度不匹配,请重试;若是直接中断,请检查您的网络、脚本管理器扩展或浏览器~`;
- if (error?.status == 403) estatus += ` 服务器说:链接已过期,关闭窗口重新获取试试吧~`;
- if (error?.status == 204 || error?.statusText === "IDM") estatus += ` 服务说:链接已被 IDM 捕获~`;
- if (error?.status == 412) estatus += ` 服务器说:需要登录才能下载~`;
- status.down_enhance_downing.find(".pl-progress .text").html(estatus);
- status.down_enhance_downing.find(".pl-progress .text").css("white-space", "break-spaces");
- })
- });
- $doc.on("click", ".listener-idm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToIDM(target.data("link"), target.data("filename"), target.data("filesize"), { "User-Agent": config.$quark.api.ua.downloadLink, "Referer": `https://${location.host}/`, "Cookie": String(document.cookie) });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-aria2-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToAria2(target.data("link"), target.data("filename"), [`User-Agent:${config.$quark.api.ua.downloadLink}`, `Referer:https://${location.host}/`, `Cookie:${document.cookie}`]);
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-bitcomet-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToBitcomet(target.data("link"), target.data("filename"), { "user_agent": config.$quark.api.ua.downloadLink, "referrer": `https://${location.host}/`, "cookie": String(document.cookie) });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
- $doc.on("click", ".listener-abdm-download", async function (e) {
- const target = $(e.currentTarget);
- if (target.attr("data-processing") === "true") return;
- target.attr("data-processing", "true");
- const originalHtml = target.html();
- target.find(".pl-icon").remove();
- target.find(".pl-loading").remove();
- target.prepend(base.createLoading());
- const res = await base.sendLinkToABDM(target.data("link"), target.data("filename"), { "User-Agent": config.$quark.api.ua.downloadLink, "Cookie": String(document.cookie) });
- if (res === "success") {
- target.removeClass("pl-btn-danger").html("发送成功啦!快去看看吧~").animate({ opacity: "0.5" }, "slow");
- } else {
- target.addClass("pl-btn-danger").text("发送失败,检查一下您的配置信息哦!").animate({ opacity: "0.5" }, "slow");
- }
- await base.sleep(3000);
- target.removeClass("pl-btn-danger").removeAttr("data-processing").html(originalHtml).css("opacity", "");
- });
},
greenerPage() {
- base.waitForKeyElements(`[class*="Activity--video-toolbar-activity"]`, function (tag) {
+ base.waitForKeyElements(`[class*="Activity--video-toolbar-activity"]`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(`span[class*="SectionHeaderController--icon-download"]`, function (tag) {
+ base.waitForKeyElements(`span[class*="SectionHeaderController--icon-download"]`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(`div[class*="SectionHeaderController--download-popover"]`, function (tag) {
+ base.waitForKeyElements(`div[class*="SectionHeaderController--download-popover"]`, (tag) => {
tag.find(".ant-popover-arrow").css({ "left": "75%" });
}, true);
- base.waitForKeyElements(`div[class*="DetailLayout--client-download"]`, function (tag) {
+ base.waitForKeyElements(`div[class*="DetailLayout--client-download"]`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".next-box.share-right-side-content", function (tag) {
+ base.waitForKeyElements(".next-box.share-right-side-content", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(`[class*="DetailLayout--container"] .feature-screen`, function (tag) {
+ base.waitForKeyElements(`[class*="DetailLayout--container"] .feature-screen`, (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".ant-modal-content .ant-modal-body .right-wrap", function (tag) {
+ base.waitForKeyElements(".ant-modal-content .ant-modal-body .right-wrap", (tag) => {
if (tag.find(".hint").text().includes("客户端")) tag.fadeOut();
}, true);
- base.waitForKeyElements(".pc-member-entrance span.button-text", function (tag) {
+ base.waitForKeyElements(".pc-member-entrance span.button-text", (tag) => {
tag.text("会员中心");
- const observer = new MutationObserver(function (mutations) {
- mutations.forEach(function () {
- if (tag.text() === "会员中心") return
+ const observer = new MutationObserver(mutations => {
+ mutations.forEach(() => {
+ if (tag.text() === "会员中心") return;
tag.text("会员中心");
});
});
const config = { subtree: true, characterData: true, childList: true };
observer.observe(tag[0], config);
}, true);
- base.waitForKeyElements(".pc-member-entrance .tips", function (tag) {
+ base.waitForKeyElements(".pc-member-entrance .tips", (tag) => {
tag.fadeOut();
}, true);
- base.waitForKeyElements(".modal .modal-content .halo-animated-background .halo-content .pay-modal .close", function (tag) {
+ base.waitForKeyElements(".modal .modal-content .halo-animated-background .halo-content .pay-modal .close", (tag) => {
tag[0].click();
}, true);
- base.waitForKeyElements(".modal .modal-content .halo-animated-background .halo-content .red-envelope .close", function (tag) {
+ base.waitForKeyElements(".modal .modal-content .halo-animated-background .halo-content .red-envelope .close", (tag) => {
tag[0].click();
}, true);
},
@@ -8408,7 +8028,7 @@ button.downloadSubtitle:disabled {
]);
base.addStyle(`${mount}-quark`, "style", `.file-list .hover-oper .hover-transparent-bg{background:transparent!important} .ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner,.ant-checkbox-wrapper .ant-checkbox-indeterminate .ant-checkbox-inner:after{background-color:${temp.color}!important}`);
},
- svg: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSI+PHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNNiA5bDIgMiAyLTJ6Ii8+PHBhdGggZD0iTTExIDVoMS41NTNjLjg1IDAgMS4xNi4wOTMgMS40Ny4yNjcuMzExLjE3NC41NTYuNDMuNzIyLjc1Ni4xNjYuMzI2LjI1NS42NS4yNTUgMS41NHY0Ljg3M2MwIC44OTItLjA4OSAxLjIxNS0uMjU1IDEuNTQtLjE2Ni4zMjctLjQxLjU4My0uNzIyLjc1Ny0uMzEuMTc0LS42Mi4yNjctMS40Ny4yNjdIMy40NDdjLS44NSAwLTEuMTYtLjA5My0xLjQ3LS4yNjdhMS43NzggMS43NzggMCAwMS0uNzIyLS43NTZjLS4xNjYtLjMyNi0uMjU1LS42NS0uMjU1LTEuNTRWNy41NjNjMC0uODkyLjA4OS0xLjIxNS4yNTUtMS41NC4xNjYtLjMyNy40MS0uNTgzLjcyMi0uNzU3LjMxLS4xNzQuNjItLjI2NyAxLjQ3LS4yNjdIOCIvPjxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTggMXY5Ii8+PC9nPjwvc3ZnPg==",
+ svg: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTUgNHYxSDIuNWEuNS41IDAgMCAwLS41LjV2OGEuNS41IDAgMCAwIC41LjVoMTFhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41SDExVjRoMi41QTEuNSAxLjUgMCAwIDEgMTUgNS41djhhMS41IDEuNSAwIDAgMS0xLjUgMS41aC0xMUExLjUgMS41IDAgMCAxIDEgMTMuNXYtOEExLjUgMS41IDAgMCAxIDIuNSA0em0zLjUtM3Y2LjVoMWwuMDg1LjAwN0EuNS41IDAgMCAxIDkuOSA4LjNsLTEuNDkyIDEuOTktLjAwOC4wMTRhLjUuNSAwIDAgMS0uOC0uMDA0bC0xLjUtMi0uMDQ2LS4wNzNBLjUuNSAwIDAgMSA2LjUgNy41aDFWMXoiLz48L3N2Zz4=",
addButton() {
base.waitForKeyElements(config.$quark.mount.home, (element) => {
temp.page = temp.main.detectPage();
@@ -8416,16 +8036,16 @@ button.downloadSubtitle:disabled {
const $button = $(`