From e78e451fb87c291f63c708abe344ec0ffa7f4d95 Mon Sep 17 00:00:00 2001 From: Saul Hetherman <126445083+YYDS678@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=B8=E5=85=8B=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/core/uzCode.js | 67 +++++++++-------------------------------------- 1 file changed, 12 insertions(+), 55 deletions(-) diff --git a/js/core/uzCode.js b/js/core/uzCode.js index 85df634..922d433 100644 --- a/js/core/uzCode.js +++ b/js/core/uzCode.js @@ -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])); - } -}