add tip for user to fill in the cookie

This commit is contained in:
yxxyun
2024-10-06 21:09:38 +08:00
parent ca783a0a2b
commit e7cd27b966

View File

@@ -131,9 +131,19 @@ class DefaultExtension extends MProvider {
let vids; let vids;
if (type === 'quark') { if (type === 'quark') {
vids = await quarkVideosExtractor(url, new SharedPreferences().get("quarkCookie")); let cookie = new SharedPreferences().get("quarkCookie");
if (cookie == "") {
throw new Error("请先在本扩展设置中填写夸克Cookies, 需要夸克VIP账号 \n Please fill in the Quark Cookies in this extension settings first, you need a Quark VIP account");
} else {
vids = await quarkVideosExtractor(url, cookie);
}
} else if (type === 'uc') { } else if (type === 'uc') {
vids = await ucVideosExtractor(url, new SharedPreferences().get("ucCookie")); let cookie = new SharedPreferences().get("ucCookie");
if (cookie == "") {
throw new Error("请先在本扩展设置中填写UC云盘Cookies, 需要UC云盘VIP账号 \n Please fill in the UC Cloud Cookies in this extension settings first, you need a UC Cloud VIP account");
} else {
vids = await ucVideosExtractor(url, cookie);
}
} else { } else {
throw new Error("不支持的链接类型"); throw new Error("不支持的链接类型");
} }