移除cat.js

This commit is contained in:
Saul Hetherman
2024-07-11 17:44:51 +08:00
parent d23c9bf421
commit b3dc3f31f1
14 changed files with 96 additions and 27466 deletions

View File

@@ -4,7 +4,7 @@
2. uzCode.js 内部定义了一些类和方法,您需要在脚本中实现 WebApiBase 的所有方法
3. uz 内部仅有一个运行时,所有 js 代码(包括脚本)都在一起加载执行。所以您的脚本内类名一定要特殊,实例名称也要特殊
4. 不支持 import export
5. 集成了 cat.js.由于不支持 export, 对 cat.js 做了简单修改
5. 集成库可在 `uz3lib.js` 查看,如需添加其他库通用库请联系[机器人](https://t.me/uzVideoAppbot)
6. 成对使用 `// ignore` uz 内部会忽略包裹的内容
7. 为您的脚本编写以下 json 配置文件

4
js/core/CryptoJS.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
js/core/JSEncrypt.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

16
js/core/cheerio.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

56
js/core/uzUtils.js Normal file
View File

@@ -0,0 +1,56 @@
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;
}
/**
* 根据正则表达式获取字符串
* @param {*} pattern
* @param {string} str
* @returns {string}
*/
static getStrByRegexDefault(pattern, str) {
let matcher = pattern.exec(str);
if (matcher !== null) {
if (matcher.length >= 1) {
if (matcher.length >= 1) return matcher[1];
}
}
return str;
}
/**
* 用于在 uz 脚本调试模式中展示 log 信息
*/
static debugLog() {
sendMessage("debugLog", JSON.stringify([...arguments]));
}
}

View File

@@ -56,7 +56,7 @@ class ChangZhang20240614 extends WebApiBase {
*/
async getVideoList(args) {
var listUrl = UZUtils.removeTrailingSlash(args.url) + "/page/" + args.page;
var backData = new RepVideoClassList();
var backData = new RepVideoList();
try {
let pro = await req(listUrl, null);
backData.error = pro.error;