支持夸克盘

This commit is contained in:
Saul Hetherman
2024-07-11 17:45:07 +08:00
parent b3dc3f31f1
commit e78e451fb8

View File

@@ -48,6 +48,8 @@ class VideoDetail {
this.vod_content = "";
// 地区
this.vod_area = "";
// 夸克网盘链接
this.quarkUrl = "";
}
}
@@ -64,29 +66,17 @@ class RepVideoClassList {
}
}
/**
* 视频列表
*/
class VideoList {
constructor() {
/**
* @type {VideoDetail[]}
*/
this.data = [];
this.total = 0;
}
}
/**
* 返回视频列表
*/
class RepVideoList {
constructor() {
/**
* @type {VideoList}
* @type {VideoDetail[]}
*/
this.data = null;
this.error = "";
this.total = 0;
}
}
@@ -181,6 +171,14 @@ class ProData {
constructor() {
this.error = "";
this.data;
/**
* @type {object} 响应头
*/
this.headers;
/**
* @type {number} 状态码
*/
this.code;
}
}
@@ -197,44 +195,3 @@ async function req(url, options) {
);
return pro;
}
class UZUtils {
/**
* 从链接中获取域名
* @param {string} url
* @returns
*/
static getHostFromURL(url) {
const protocolEndIndex = url.indexOf("://");
if (protocolEndIndex === -1) {
return null;
}
const hostStartIndex = protocolEndIndex + 3;
const hostEndIndex = url.indexOf("/", hostStartIndex);
const host =
hostEndIndex === -1
? url.slice(hostStartIndex)
: url.slice(hostStartIndex, hostEndIndex);
return `${url.slice(0, protocolEndIndex + 3)}${host}`;
}
/**
* 去除尾部的斜杠
* @param {string} str
* @returns
*/
static removeTrailingSlash(str) {
if (str.endsWith("/")) {
return str.slice(0, -1);
}
return str;
}
/**
* 用于在 uz 脚本调试模式中展示 log 信息
*/
static debugLog() {
sendMessage("debugLog", JSON.stringify([...arguments]));
}
}