Add files via upload

This commit is contained in:
潇洒 2024-05-26 13:39:40 +08:00 committed by GitHub
parent 9a8d173189
commit 6c4bf621a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1166 additions and 660 deletions

554
JS/drpy2.min.js vendored
View File

@ -1,6 +1,8 @@
import cheerio from "assets://js/lib/cheerio.min.js";
import "assets://js/lib/crypto-js.js";
import "./jsencrypt.js";
import "./node-rsa.js";
import "./pako.min.js";
import 模板 from "./模板.js";
import {
gbkTool
@ -10,10 +12,172 @@ from "./gbk.js";
function init_test() {
console.log("init_test_start");
console.log("当前版本号:" + VERSION);
console.log("本地代理地址:" + getProxyUrl());
console.log(RKEY);
console.log(JSON.stringify(rule));
console.log("init_test_end")
}
function ocr_demo_test() {
let img_base64 = `iVBORw0KGgoAAAANSUhEUgAAAIAAAAAoBAMAAADEX+97AAAAG1BMVEXz+/4thQTa7N6QwIFFkyNeokKozqDB3b93sWHFR+MEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABN0lEQVRIie2TQU+DQBCFt9vScvQpxR4xrcSjJCZ67JDGXsX+AdR4B3vpsSYm/m2HXaRLmuySepR3Gdidb/btDAjRq5dT96eCMlfBuzi1QLZUoZy2yz5sOvI+9iomaPEZ6nWnEtxqIyiM1RcAy44GNDhBXUjot/VVNweV1ah68FqWRyjKIOqAcyYF6rGcmpYnHzGt3fycNoMw0d3/THFu7hFSJ/8OXO6iTM8/KSg09obAzIHLO250LgQ0txOZSfgrV4Exdw98uGycJ0ErAeExZGhOmFHV9zHO6qVSj0MpLq7xZON56o++MjlsEgfVhbQWWME+xQX7J4V6zfi9A1Ly9rP1BvEXp+BbVJ/M77n+wfOIDVp51pZ4iBxvmj9AGrtvry6emwfKnVkW+ZRKd5ZNMvob36vXP9YPDmQki8QiCFAAAAAASUVORK5CYII=`;
OcrApi.api = OCR_API;
let code = OcrApi.classification(img_base64);
log("测试验证码图片的ocr识别结果为:" + code)
}
function rsa_demo_test() {
let t1 = (new Date)
.getTime();
let pkcs1_public = `
-----BEGIN RSA PUBLIC KEY-----
MEgCQQCrI0pQ/ERRpJ3Ou190XJedFq846nDYP52rOtXyDxlFK5D3p6JJu2RwsKwy
lsQ9xY0xYPpRZUZKMEeR7e9gmRNLAgMBAAE=
-----END RSA PUBLIC KEY-----
`.trim();
let pkcs1_public_pem = `
MEgCQQCrI0pQ/ERRpJ3Ou190XJedFq846nDYP52rOtXyDxlFK5D3p6JJu2RwsKwy
lsQ9xY0xYPpRZUZKMEeR7e9gmRNLAgMBAAE=
`.trim();
let pkcs8_public = `
-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKsjSlD8RFGknc67X3Rcl50WrzjqcNg/
nas61fIPGUUrkPenokm7ZHCwrDKWxD3FjTFg+lFlRkowR5Ht72CZE0sCAwEAAQ==
-----END PUBLIC KEY-----`.trim();
let pkcs8_public_pem = `
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKsjSlD8RFGknc67X3Rcl50WrzjqcNg/
nas61fIPGUUrkPenokm7ZHCwrDKWxD3FjTFg+lFlRkowR5Ht72CZE0sCAwEAAQ==
`.trim();
let pkcs1_private = `
-----BEGIN RSA PRIVATE KEY-----
MIIBOAIBAAJBAKsjSlD8RFGknc67X3Rcl50WrzjqcNg/nas61fIPGUUrkPenokm7
ZHCwrDKWxD3FjTFg+lFlRkowR5Ht72CZE0sCAwEAAQI/b6OV1z65UokQaMvSeRXt
0Yv6wiYtduQI9qpq5nzy/ytaqsbBfClNTi/HifKPKxlRouWFkc518EQI8LBxoarJ
AiEA4DaONMplV8PQNa3TKn2F+SDEvLOCjdL0kHKdN90Ti28CIQDDZnTBaHgZwZbA
hS7Bbf5yvwjWMhO6Y7l04/Qm7R+35QIgPuQuqXIoUSD080mp1N5WyRW++atksIF+
5lGv9e6GP/MCICnj8y/rl6Pd7tXDN6zcSeqLrfdNsREKhB3dKOCXgW9JAiAFYtFS
EJNBXVRTK42SNsZ2hJ/9xLwOwnH2epT8Q43s3Q==
-----END RSA PRIVATE KEY-----
`.trim();
let pkcs8_private = `
-----BEGIN PRIVATE KEY-----
MIIBUgIBADANBgkqhkiG9w0BAQEFAASCATwwggE4AgEAAkEAqyNKUPxEUaSdzrtf
dFyXnRavOOpw2D+dqzrV8g8ZRSuQ96eiSbtkcLCsMpbEPcWNMWD6UWVGSjBHke3v
YJkTSwIDAQABAj9vo5XXPrlSiRBoy9J5Fe3Ri/rCJi125Aj2qmrmfPL/K1qqxsF8
KU1OL8eJ8o8rGVGi5YWRznXwRAjwsHGhqskCIQDgNo40ymVXw9A1rdMqfYX5IMS8
s4KN0vSQcp033ROLbwIhAMNmdMFoeBnBlsCFLsFt/nK/CNYyE7pjuXTj9CbtH7fl
AiA+5C6pcihRIPTzSanU3lbJFb75q2SwgX7mUa/17oY/8wIgKePzL+uXo93u1cM3
rNxJ6out902xEQqEHd0o4JeBb0kCIAVi0VIQk0FdVFMrjZI2xnaEn/3EvA7CcfZ6
lPxDjezd
-----END PRIVATE KEY-----
`.trim();
let data = `
NodeRsa
这是node-rsa 现在修改集成在drpy里使用`.trim();
let encryptedWithPublic = NODERSA.encryptRSAWithPublicKey(data, pkcs1_public, {
outputEncoding: "base64",
options: {
environment: "browser",
encryptionScheme: "pkcs1_oaep"
}
});
console.log("公钥加密");
console.log(encryptedWithPublic);
let decryptedWithPrivate = NODERSA.decryptRSAWithPrivateKey(encryptedWithPublic, pkcs1_private, {
options: {
environment: "browser",
encryptionScheme: "pkcs1_oaep"
}
});
console.log("私钥解密");
console.log(decryptedWithPrivate);
let pkcs1_sha256_sign = NODERSA.sign("1", pkcs1_private, {
outputEncoding: "base64",
options: {
environment: "browser",
encryptionScheme: "pkcs1",
signingScheme: "pkcs1-sha256"
}
});
console.log("pkcs1_sha256_sign");
console.log(pkcs1_sha256_sign);
let pkcs1_sha256_sign_verify = NODERSA.verify("1", "Oulx2QrgeipKYBtqEDqFb2s/+ndk2cGQxO4CkhU7iBM1vyNmmvqubpsmeoUuN3waGrYZLknSEdwBkfv0tUMpFQ==", pkcs1_private, {
options: {
environment: "browser",
encryptionScheme: "pkcs1",
signingScheme: "pkcs1-sha256"
}
});
console.log("pkcs1_sha256_sign_verify");
console.log(pkcs1_sha256_sign_verify);
let pkcs1_oaep_sha256 = NODERSA.encryptRSAWithPublicKey(data, `-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEA5KOq1gRNyllLNWKQy8sGpZE3Q1ULLSmzZw+eaAhj9lvqn7IsT1du
SYn08FfoOA2qMwtz+1O2l1mgzNoSVCyVpVabnTG+C9XKeZXAnJHd8aYA7l7Sxhdm
kte+iymYZ0ZBPzijo8938iugtVvqi9UgDmnY3u/NlQDqiL5BGqSxSTd/Sgmy3zD8
PYzEa3wD9vehQ5fZZ45vKIq8GNVh2Z8+IGO85FF1OsN7+b2yGJa/FmDDNn0+HP+m
PfI+kYBqEVpo0Ztbc3UdxgFwGC8O1n8AQyriwHnSOtIiuBH62J/7qyC/3LEAApRb
Dd9YszqzmODjQUddZKHmvc638VW+azc0EwIDAQAB
-----END RSA PUBLIC KEY-----
`, {
outputEncoding: "base64",
options: {
environment: "browser",
encryptionScheme: {
scheme: "pkcs1_oaep",
hash: "sha256"
}
}
});
console.log("pkcs1_oaep_sha256");
console.log(pkcs1_oaep_sha256);
decryptedWithPrivate = NODERSA.decryptRSAWithPrivateKey("kSZesAAyYh2hdsQnYMdGqb6gKAzTauBKouvBzWcc4+F8RvGd0nwO6mVkUMVilPgUuNxjEauHayHiY8gI3Py45UI3+km0rSGyHrS6dHiHgCkMejXHieglYzAB0IxX3Jkm4z/66bdB/D+GFy0oct5fGCMI1UHPjEAYOsazJDa8lBFNbjiWFeb/qiZtIx3vGM7KYPAZzyRf/zPbbQ8zy9xOmRuOl5nnIxgo0Okp3KO/RIPO4GZOSBA8f2lx1UtNwwrXAMpcNavtoqHVcjJ/9lcotXYQFrn5b299pSIRf2gVm8ZJ31SK6Z8cc14nKtvgnmsgClDzIXJ1o1RcDK+knVAySg==", `-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA5KOq1gRNyllLNWKQy8sGpZE3Q1ULLSmzZw+eaAhj9lvqn7Is
T1duSYn08FfoOA2qMwtz+1O2l1mgzNoSVCyVpVabnTG+C9XKeZXAnJHd8aYA7l7S
xhdmkte+iymYZ0ZBPzijo8938iugtVvqi9UgDmnY3u/NlQDqiL5BGqSxSTd/Sgmy
3zD8PYzEa3wD9vehQ5fZZ45vKIq8GNVh2Z8+IGO85FF1OsN7+b2yGJa/FmDDNn0+
HP+mPfI+kYBqEVpo0Ztbc3UdxgFwGC8O1n8AQyriwHnSOtIiuBH62J/7qyC/3LEA
ApRbDd9YszqzmODjQUddZKHmvc638VW+azc0EwIDAQABAoIBADZ/QGgUzInvsLp/
zO2WbfYm39o/uhNAvk9RbLt1TIZbMFhyOpeKynHi3Swwd9xsfWX/U9zS/lGi/m31
iKrhmaW4OA1G3vqpMcK7TBbFufYwUEaA+ZJX344euH8pIfdzyneMQ4z3Far2dS7l
QsmjuilVV2kEFadveXewiYoVOWCu00w6bN8wy2SIHlQn+kIL6HQhWz12iKKflIKu
eGRdzLHsKmBt6WbY1Wuhx7HU0fAKdlBDPxCHNlI+kybUYE9o5C2vJiaVM5wqJBgZ
8Dz8kt1QbLJ910JoLXkLVQ8uC8NJKQwFtqQjTGPnEq0+wbgz6Ij599rKZkwW/xq9
l6KoUiECgYEA6Ah42tVdkNW047f03xVYXFH96RgorHRS36mR8Y+ONUq1fwKidovC
WjwVujt4OPf3l1W6iyn/F6cu/bsmvPrSc3HTN0B1V31QK4OjgetxQ2PSbTldH02J
NPzkt+v+cPxXpx/P5mgt7Weefw5txU547KubGrHUV5rBKFtIx9pj16MCgYEA/EF0
o19+D24DZAPwlDS5VbEd7FStnwY4oQ5PqbuNOSbSJLMWU0AqzXcRokp8UTyCZ0X3
ATkS1REq97kShCuR+npTR6a6DlY7sdpPI1SMLNajgB2tkx0EOzX+PfNIbHUd4jpJ
I0ZMAHv/OOtkzQHDaeTWBTrzsWm6/nTiykfduNECgYEA46AMD4HpPECqKAs66e5i
tI6q7JSKskObWVdcmQEfnSAhVOwcvPb2Ptda6UuV8S0xcwDi88rLOUUFUFzc79+P
vTkY38cYVi/VChsluDpk7ptqv0PbGu5Rf+3n4pZdEjI7OvR2W64wAAn67uIUxc7p
yiO/ET0K9rYWb6S9jXGtKMkCgYEA2kPAqoO7zZoBMQ7/oR0lp/HC1HRIbiqx4RlC
8Lgpb+QZPEwA6zPAVVvLVENi4d+bbcRp/xLlKpraNNJcJSSWAMbLPFoU7sbKjA87
HnTPfRSTEA2d3Ibk3F7Rh8TzS3Ti0JZiJjVzGZAwu41iAMifzwaD8K6boUy80eNN
QH2CaaECgYBUsLYvC/MiYg3w+LGOONuQongoVUXjGqnw2bjVa9RK7lwRdXPUqJ51
MpVO98IkoLvGSI/0sGNP3GKNhC+eMGjJAVwFyEuOn+JsmMv9Y9uStIVi5tIHIhKw
m7mp8il0kaftHdSxTbspG3tZ2fjIiFIZkLEOmRpd7ogWumgOajzUdA==
-----END RSA PRIVATE KEY-----`, {
options: {
environment: "browser",
encryptionScheme: "pkcs1_oaep"
}
});
console.log("decryptedWithPrivate");
console.log(decryptedWithPrivate);
(() => {
let key = new NODERSA.NodeRSA({
b: 1024
});
key.setOptions({
encryptionScheme: "pkcs1"
});
let text = `你好drpy node-ras`;
let encrypted = key.encrypt(text, "base64");
console.log("encrypted: ", encrypted);
const decrypted = key.decrypt(encrypted, "utf8");
console.log("decrypted: ", decrypted)
})();
let t2 = (new Date)
.getTime();
console.log("rsa_demo_test 测试耗时:" + (t2 - t1) + "毫秒")
}
function pre() {
if (typeof rule.预处理 === "string" && rule.预处理 && rule.预处理.trim()) {
let code = rule.预处理.trim();
@ -30,7 +194,7 @@ function pre() {
}
let rule = {};
let vercode = typeof pdfl === "function" ? "drpy2.1" : "drpy2";
const VERSION = vercode + " 3.9.49beta40 202400426";
const VERSION = vercode + " 3.9.50beta17 202400524";
const MOBILE_UA = "Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36";
const PC_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36";
const UA = "Mozilla/5.0";
@ -40,7 +204,7 @@ const RULE_CK = "cookie";
const CATE_EXCLUDE = "首页|留言|APP|下载|资讯|新闻|动态";
const TAB_EXCLUDE = "猜你|喜欢|下载|剧情|热播";
const OCR_RETRY = 3;
const OCR_API = "http://drpy.nokia.press:8028/ocr/drpy/text";
const OCR_API = "https://api.nn.ci/ocr/b64/text";
if (typeof MY_URL === "undefined") {
var MY_URL
}
@ -61,6 +225,91 @@ const NOADD_INDEX = /:eq|:lt|:gt|:first|:last|^body$|^#/;
const URLJOIN_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/;
const SELECT_REGEX = /:eq|:lt|:gt|#/g;
const SELECT_REGEX_A = /:eq|:lt|:gt/g;
const $js = {
toString(func) {
let strfun = func.toString();
return strfun.replace(/^\(\)(\s+)?=>(\s+)?\{/, "js:")
.replace(/\}$/, "")
}
};
function window_b64() {
let b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
let base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
function btoa(str) {
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while (i < len) {
c1 = str.charCodeAt(i++) & 255;
if (i == len) {
out += b64map.charAt(c1 >> 2);
out += b64map.charAt((c1 & 3) << 4);
out += "==";
break
}
c2 = str.charCodeAt(i++);
if (i == len) {
out += b64map.charAt(c1 >> 2);
out += b64map.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
out += b64map.charAt((c2 & 15) << 2);
out += "=";
break
}
c3 = str.charCodeAt(i++);
out += b64map.charAt(c1 >> 2);
out += b64map.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
out += b64map.charAt((c2 & 15) << 2 | (c3 & 192) >> 6);
out += b64map.charAt(c3 & 63)
}
return out
}
function atob(str) {
var c1, c2, c3, c4;
var i, len, out;
len = str.length;
i = 0;
out = "";
while (i < len) {
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 255]
} while (i < len && c1 == -1);
if (c1 == -1) break;
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 255]
} while (i < len && c2 == -1);
if (c2 == -1) break;
out += String.fromCharCode(c1 << 2 | (c2 & 48) >> 4);
do {
c3 = str.charCodeAt(i++) & 255;
if (c3 == 61) return out;
c3 = base64DecodeChars[c3]
} while (i < len && c3 == -1);
if (c3 == -1) break;
out += String.fromCharCode((c2 & 15) << 4 | (c3 & 60) >> 2);
do {
c4 = str.charCodeAt(i++) & 255;
if (c4 == 61) return out;
c4 = base64DecodeChars[c4]
} while (i < len && c4 == -1);
if (c4 == -1) break;
out += String.fromCharCode((c3 & 3) << 6 | c4)
}
return out
}
return {
atob: atob,
btoa: btoa
}
}
if (typeof atob != "function" || typeof btoa != "function") {
var {
atob, btoa
} = window_b64()
}
if (typeof Object.assign != "function") {
Object.assign = function() {
let target = arguments[0];
@ -107,7 +356,8 @@ if (!Array.prototype.includes) {
k++
}
return false
}
},
enumerable: false
})
}
if (typeof String.prototype.startsWith != "function") {
@ -120,20 +370,8 @@ if (typeof String.prototype.endsWith != "function") {
return this.indexOf(suffix, this.length - suffix.length) !== -1
}
}
Object.prototype.myValues = function(obj) {
if (obj == null) {
throw new TypeError("Cannot convert undefined or null to object")
}
var res = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
res.push(obj[k])
}
}
return res
};
if (typeof Object.prototype.values != "function") {
Object.prototype.values = function(obj) {
Object.defineProperty(Object.prototype, "myValues", {
value: function(obj) {
if (obj == null) {
throw new TypeError("Cannot convert undefined or null to object")
}
@ -144,44 +382,77 @@ if (typeof Object.prototype.values != "function") {
}
}
return res
}
},
enumerable: false
});
if (typeof Object.prototype.values != "function") {
Object.defineProperty(Object.prototype, "values", {
value: function(obj) {
if (obj == null) {
throw new TypeError("Cannot convert undefined or null to object")
}
var res = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
res.push(obj[k])
}
}
return res
},
enumerable: false
})
}
if (typeof Array.prototype.join != "function") {
Array.prototype.join = function(emoji) {
emoji = emoji || "";
let self = this;
let str = "";
let i = 0;
if (!Array.isArray(self)) {
throw String(self) + "is not Array"
}
if (self.length === 0) {
return ""
}
if (self.length === 1) {
return String(self[0])
}
i = 1;
str = this[0];
for (; i < self.length; i++) {
str += String(emoji) + String(self[i])
}
return str
}
Object.defineProperty(Array.prototype, "join", {
value: function(emoji) {
emoji = emoji || "";
let self = this;
let str = "";
let i = 0;
if (!Array.isArray(self)) {
throw String(self) + "is not Array"
}
if (self.length === 0) {
return ""
}
if (self.length === 1) {
return String(self[0])
}
i = 1;
str = this[0];
for (; i < self.length; i++) {
str += String(emoji) + String(self[i])
}
return str
},
enumerable: false
})
}
if (typeof Array.prototype.toReversed != "function") {
Array.prototype.toReversed = function() {
const clonedList = this.slice();
const reversedList = clonedList.reverse();
return reversedList
}
Object.defineProperty(Array.prototype, "toReversed", {
value: function() {
const clonedList = this.slice();
const reversedList = clonedList.reverse();
return reversedList
},
enumerable: false
})
}
String.prototype.rstrip = function(chars) {
let regex = new RegExp(chars + "$");
return this.replace(regex, "")
};
Array.prototype.append = Array.prototype.push;
String.prototype.strip = String.prototype.trim;
Object.defineProperty(Array.prototype, "append", {
value: Array.prototype.push,
enumerable: false
});
Object.defineProperty(String.prototype, "strip", {
value: String.prototype.trim,
enumerable: false
});
Object.defineProperty(String.prototype, "rstrip", {
value: function(chars) {
let regex = new RegExp(chars + "$");
return this.replace(regex, "")
},
enumerable: false
});
function 是否正版(vipUrl) {
let flag = new RegExp("qq.com|iqiyi.com|youku.com|mgtv.com|bilibili.com|sohu.com|ixigua.com|pptv.com|miguvideo.com|le.com|1905.com|fun.tv");
@ -336,6 +607,59 @@ function md5(text) {
return CryptoJS.MD5(text)
.toString()
}
function uint8ArrayToBase64(uint8Array) {
let binaryString = String.fromCharCode.apply(null, Array.from(uint8Array));
return btoa(binaryString)
}
function Utf8ArrayToStr(array) {
var out, i, len, c;
var char2, char3;
out = "";
len = array.length;
i = 0;
while (i < len) {
c = array[i++];
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
out += String.fromCharCode(c);
break;
case 12:
case 13:
char2 = array[i++];
out += String.fromCharCode((c & 31) << 6 | char2 & 63);
break;
case 14:
char2 = array[i++];
char3 = array[i++];
out += String.fromCharCode((c & 15) << 12 | (char2 & 63) << 6 | (char3 & 63) << 0);
break
}
}
return out
}
function gzip(str) {
let arr = pako.gzip(str, {
to: "string"
});
return uint8ArrayToBase64(arr)
}
function ungzip(b64Data) {
let strData = atob(b64Data);
const charData = strData.split("")
.map(function(x) {
return x.charCodeAt(0)
});
const binData = new Uint8Array(charData);
const data = pako.inflate(binData);
return Utf8ArrayToStr(data)
}
function encodeStr(input, encoding) {
encoding = encoding || "gbk";
if (encoding.startsWith("gb")) {
@ -472,9 +796,12 @@ function fixAdM3u8(m3u8_text, m3u8_url, ad_remove) {
.trim();
return m3u8_text
}
function fixAdM3u8Ai(m3u8_url) {
function fixAdM3u8Ai(m3u8_url, headers) {
let ts = (new Date)
.getTime();
let option = headers ? {
headers: headers
} : {};
function b(s1, s2) {
let i = 0;
@ -491,16 +818,22 @@ function fixAdM3u8Ai(m3u8_url) {
.reverse()
.join("")
}
let m3u8 = request(m3u8_url);
let m3u8 = request(m3u8_url, option);
m3u8 = m3u8.trim()
.split("\n")
.map(it => it.startsWith("#") ? it : urljoin(m3u8_url, it))
.join("\n");
m3u8 = m3u8.replace(/\n\n/gi, "\n");
let last_url = m3u8.split("\n")
.slice(-1)[0];
if (last_url.length < 5) {
last_url = m3u8.split("\n")
.slice(-2)[0]
}
if (last_url.includes(".m3u8") && last_url !== m3u8_url) {
m3u8_url = last_url;
m3u8 = request(m3u8_url)
m3u8_url = urljoin2(m3u8_url, last_url);
log("嵌套的m3u8_url:" + m3u8_url);
m3u8 = request(m3u8_url, option)
}
let s = m3u8.trim()
.split("\n")
@ -513,12 +846,14 @@ function fixAdM3u8Ai(m3u8_url) {
let ml = Math.round(ss.length / 2)
.toString()
.length;
let maxc = 0;
let laststr = ss.toReversed()
.find(x => {
if (!x.startsWith("#")) {
let k = b(reverseString(firststr), reverseString(x));
maxl = b(firststr, x);
if (firststrlen - maxl <= ml + k) {
maxc++;
if (firststrlen - maxl <= ml + k || maxc > 10) {
return true
}
}
@ -587,6 +922,26 @@ let LISTS = [];
globalThis.encodeUrl = urlencode;
globalThis.urlencode = urlencode;
function getQuery(url) {
try {
if (url.indexOf("?") > -1) {
url = url.slice(url.indexOf("?") + 1)
}
let arr = url.split("#")[0].split("&");
const resObj = {};
arr.forEach(item => {
let arr1 = item.split("=");
let key = arr1[0];
let value = arr1.slice(1)
.join("=");
resObj[key] = value
});
return resObj
} catch (err) {
log("getQuery发生错误:" + e.message);
return {}
}
}
function urljoin(fromPath, nowPath) {
fromPath = fromPath || "";
nowPath = nowPath || "";
@ -774,15 +1129,22 @@ var OcrApi = {
let code = "";
try {
log("通过drpy_ocr验证码接口过验证...");
let html = request(OCR_API, {
data: {
img: img
},
headers: {
"User-Agent": PC_UA
},
method: "POST"
}, true);
let html = "";
if (this.api.endsWith("drpy/text")) {
html = request(this.api, {
data: {
img: img
},
headers: {
"User-Agent": PC_UA
},
method: "POST"
}, true)
} else {
html = post(this.api, {
body: img
})
}
code = html || ""
} catch (e) {
log(`OCR识别验证码发生错误:${e.message}`)
@ -877,7 +1239,7 @@ function buildUrl(url, obj) {
url += prs;
return url
}
function require(url) {
function $require(url) {
eval(request(url))
}
function request(url, obj, ocr_flag) {
@ -950,6 +1312,27 @@ function post(url, obj) {
obj.method = "POST";
return request(url, obj)
}
function reqCookie(url, obj, all_cookie) {
obj = obj || {};
obj.withHeaders = true;
all_cookie = all_cookie || false;
let html = request(url, obj);
let json = JSON.parse(html);
let setCk = Object.keys(json)
.find(it => it.toLowerCase() === "set-cookie");
let cookie = setCk ? json[setCk] : "";
if (Array.isArray(cookie)) {
cookie = cookie.join(";")
}
if (!all_cookie) {
cookie = cookie.split(";")[0]
}
html = json.body;
return {
cookie: cookie,
html: html
}
}
fetch = request;
print = function(data) {
data = data || "";
@ -1307,6 +1690,7 @@ function categoryParse(cateObj) {
} else {
url = url.replace("fyfilter", rule.filter_url)
}
url = url.replaceAll("fyclass", cateObj.tid);
let fl = cateObj.filter ? cateObj.extend : {};
if (rule.filter_def && typeof rule.filter_def === "object") {
try {
@ -1874,7 +2258,11 @@ function detailParse(detailObj) {
let t2 = (new Date)
.getTime();
console.log(`加载二级界面${MY_URL}耗时:${t2-t1}毫秒`);
vod = vodDeal(vod);
try {
vod = vodDeal(vod)
} catch (e) {
console.log(`vodDeal发生错误:${e.message}`)
}
return JSON.stringify({
list: [vod]
})
@ -1950,8 +2338,11 @@ function playParse(playObj) {
lazy_play = common_play
} else if (rule.play_parse && rule.lazy && typeof rule.lazy === "string") {
try {
let lazy_code = rule.lazy.replace("js:", "")
.trim();
let lazy_code = rule.lazy.trim();
if (lazy_code.startsWith("js:")) {
lazy_code = lazy_code.replace("js:", "")
.trim()
}
print("开始执行js免嗅=>" + lazy_code);
eval(lazy_code);
lazy_play = typeof input === "object" ? input : {
@ -2037,13 +2428,19 @@ function init(ext) {
if (typeof ext == "object") {
rule = ext
} else if (typeof ext == "string") {
if (ext.startsWith("http")) {
if (ext.startsWith("http") || ext.startsWith("file://")) {
let query = getQuery(ext);
let js = request(ext, {
method: "GET"
});
if (js) {
eval(js.replace("var rule", "rule"))
}
if (query.type === "url" && query.params) {
rule.params = urljoin(ext, query.params)
} else if (query.params) {
rule.params = query.params
}
} else {
eval(ext.replace("var rule", "rule"))
}
@ -2109,9 +2506,15 @@ function init(ext) {
rule.play_json = rule.hasOwnProperty("play_json") ? rule.play_json : [];
rule.pagecount = rule.hasOwnProperty("pagecount") ? rule.pagecount : {};
rule.proxy_rule = rule.hasOwnProperty("proxy_rule") ? rule.proxy_rule : "";
if (!rule.hasOwnProperty("sniffer")) {
rule.sniffer = false
}
rule.sniffer = rule.hasOwnProperty("sniffer") ? rule.sniffer : "";
rule.sniffer = !! (rule.sniffer && rule.sniffer !== "0" && rule.sniffer !== "false");
rule.isVideo = rule.hasOwnProperty("isVideo") ? rule.isVideo : "";
if (rule.sniffer && !rule.isVideo) {
rule.isVideo = "http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)|http((?!http).)*?video/tos*|http((?!http).)*?obj/tos*"
}
rule.tab_remove = rule.hasOwnProperty("tab_remove") ? rule.tab_remove : [];
rule.tab_order = rule.hasOwnProperty("tab_order") ? rule.tab_order : [];
rule.tab_rename = rule.hasOwnProperty("tab_rename") ? rule.tab_rename : {};
@ -2160,6 +2563,15 @@ let homeHtmlCache = undefined;
function home(filter) {
console.log("home");
if (typeof rule.filter === "string" && rule.filter.trim()
.length > 0) {
try {
let filter_json = ungzip(rule.filter.trim());
rule.filter = JSON.parse(filter_json)
} catch (e) {
rule.filter = {}
}
}
let homeObj = {
filter: rule.filter || false,
MY_URL: rule.homeUrl,
@ -2298,7 +2710,8 @@ function DRPY() {
search: search,
proxy: proxy,
sniffer: sniffer,
isVideo: isVideo
isVideo: isVideo,
fixAdM3u8Ai: fixAdM3u8Ai
}
}
export
@ -2313,5 +2726,6 @@ default {
proxy: proxy,
sniffer: sniffer,
isVideo: isVideo,
fixAdM3u8Ai: fixAdM3u8Ai,
DRPY: DRPY
};

File diff suppressed because one or more lines are too long

2
JS/node-rsa.js Normal file

File diff suppressed because one or more lines are too long

2
JS/pako.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,23 +1,38 @@
var rule = {
title: '喵物次元',
host: 'https://catw.moe',
模板:'短视2',
searchUrl: '/index.php/vod/search/wd/**.html',
url:'index.php/vod/show/id/fyclass/page/fypage.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 1,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {
'User-Agent': 'MOBILE_UA'
},
play_parse: true,
lazy: '',
limit: 6,
tab_rename:{'喵物次元':'LR',},
class_name:'TV动画&剧场版&特摄剧',
class_url:'1&2&20',
double: false, // 推荐内容是否双层定位
推荐: '*',
一级: '.public-list-exp;a&&title;img&&data-src;.ft2&&Text;a&&href',
搜索: '.public-list-box;.thumb-txt&&Text;.public-list-exp&&img&&data-src;.public-list-prb&&Text;a&&href'
}
title:'喵物次元',
host:'https://www.mwcy.net/',
url:'/catshow/fyclass/fypage.html',
searchUrl:'/catsearch/page/fypage/wd/**.html',
searchable:2,
quickSearch:0,
filterable:1,
filter:'',
filter_url:'',
filter_def:{},
headers:{
'User-Agent':'MOBILE_UA',
},
timeout:5000,
class_parse:'div.head-more a;a&&Text;a&&href;.*/(.*?)\.html',
cate_exclude:'特摄剧|我的|专题|排行榜|周番剧表',
play_parse:true,
lazy:$js.toString(()=>{
input = {parse:1,url:input,js:''};
}),
double:true,
//推荐:'.public-list-div;a;a&&title;img&&data-src;.public-list-prb&&Text;a&&href',
一级:'.public-list-div a;a&&title;img&&data-src;span:eq(1)&&Text;a&&href;详情',
二级:{
title:'h3&&Text;.style-detail span:eq(7)&&Text',
img:'.style-detail&&img&&data-src',
desc:'主要信息;.style-detail&&a&&Text;地区;.style-detail&&.slide-info:eq(2)&&Text;.style-detail&&a:eq(2)&&Text',
content:'#height_limit&&Text',
tabs:'.nav-swiper a',
lists:'.anthology-list-play li',
tab_text:'body&&Text',
list_text:'body&&Text',
list_url:'a&&href',
list_url_prefix: '',
},
搜索:'.box-width:eq(1)&&.public-list-exp;.public-list-exp&&img&&alt;.public-list-exp&&img&&data-src;.public-list-exp&&span&&Text;a&&href',
}

View File

@ -1,304 +1,377 @@
if (typeof Object.assign != 'function') {
Object.assign = function () {
var target = arguments[0];
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
}
function getMubans() {
var mubanDict = { // 模板字典
mxpro: {
title: '',
host: '',
// homeUrl:'/',
url: '/vodshow/fyclass--------fypage---.html',
searchUrl: '/vodsearch/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent': 'MOBILE_UA',
// "Cookie": "searchneed=ok"
},
class_parse: '.navbar-items li:gt(2):lt(8);a&&Text;a&&href;/(\\d+).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href',
二级: {
"title": "h1&&Text;.module-info-tag&&Text",
"img": ".lazyload&&data-original",
"desc": ".module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text",
"content": ".module-info-introduction&&Text",
"tabs": ".module-tab-item",
"lists": ".module-play-list:eq(#id) a"
},
搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text',
},
mxone5: {
title: '',
host: '',
url: '/show/fyclass--------fypage---.html',
searchUrl: '/search/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
二级: {
"title": "h1&&Text;.tag-link&&Text",
"img": ".module-item-pic&&img&&data-src",
"desc": ".video-info-items:eq(0)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(2)&&Text;.video-info-items:eq(3)&&Text",
"content": ".vod_content&&Text",
"tabs": ".module-tab-item",
"lists": ".module-player-list:eq(#id)&&.scroll-content&&a"
},
搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
},
首图: {
title: '',
host: '',
url: '/vodshow/fyclass--------fypage---/',
searchUrl: '/vodsearch/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent': 'MOBILE_UA',
// "Cookie": "searchneed=ok"
},
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(5);a&&Text;a&&href;/(\\d+).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
二级: {
"title": ".myui-content__detail .title&&Text;.myui-content__detail p:eq(-2)&&Text",
"img": ".myui-content__thumb .lazyload&&data-original",
"desc": ".myui-content__detail p:eq(0)&&Text;.myui-content__detail p:eq(1)&&Text;.myui-content__detail p:eq(2)&&Text",
"content": ".content&&Text",
"tabs": ".nav-tabs:eq(0) li",
"lists": ".myui-content__list:eq(#id) li"
},
搜索: '#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
},
首图2: {
title: '',
host: '',
url: '/list/fyclass-fypage.html',
searchUrl: '/vodsearch/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {
'User-Agent': 'UC_UA',
// "Cookie": ""
},
// class_parse:'.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
二级: {
"title": ".stui-content__detail .title&&Text;.stui-content__detail p:eq(-2)&&Text",
"img": ".stui-content__thumb .lazyload&&data-original",
"desc": ".stui-content__detail p:eq(0)&&Text;.stui-content__detail p:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text",
"content": ".detail&&Text",
"tabs": ".stui-vodlist__head h3",
"lists": ".stui-content__playlist:eq(#id) li"
},
搜索: 'ul.stui-vodlist__media:eq(0) li,ul.stui-vodlist:eq(0) li,#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
搜索1: 'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
搜索2: 'ul.stui-vodlist__media&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
},
默认: {
title: '',
host: '',
url: '/vodshow/fyclass--------fypage---.html',
searchUrl: '/vodsearch/-------------.html?wd=**',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {
'User-Agent': 'MOBILE_UA',
},
play_parse: true,
lazy: '',
limit: 6,
double: true, // 推荐内容是否双层定位
},
vfed: {
title: '',
host: '',
url: '/index.php/vod/show/id/fyclass/page/fypage.html',
searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {
'User-Agent': 'UC_UA',
},
// class_parse:'.fed-pops-navbar&&ul.fed-part-rows&&a.fed-part-eone:gt(0):lt(5);a&&Text;a&&href;.*/(.*?).html',
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
二级: {
"title": "h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text",
"img": ".fed-list-info&&a&&data-original",
"desc": ".fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text",
"content": ".fed-part-esan&&Text",
"tabs": ".fed-drop-boxs&&.fed-part-rows&&li",
"lists": ".fed-play-item:eq(#id)&&ul:eq(1)&&li"
},
搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
},
海螺3: {
title: '',
host: '',
searchUrl: '/v_search/**----------fypage---.html',
url: '/vod_____show/fyclass--------fypage---.html',
headers: {
'User-Agent': 'MOBILE_UA'
},
timeout: 5000,
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
cate_exclude: '明星|专题|最新|排行',
limit: 40,
play_parse: true,
lazy: '',
推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
double: true,
一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
二级: {
"title": ".hl-infos-title&&Text;.hl-text-conch&&Text",
"img": ".hl-lazy&&data-original",
"desc": ".hl-infos-content&&.hl-text-conch&&Text",
"content": ".hl-content-text&&Text",
"tabs": ".hl-tabs&&a",
"lists": ".hl-plays-list:eq(#id)&&li"
},
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
},
海螺2: {
title: '',
host: '',
searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
url: '/index.php/vod/show/id/fyclass/page/fypage/',
headers: {
'User-Agent': 'MOBILE_UA'
},
timeout: 5000,
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
limit: 40,
play_parse: true,
lazy: '',
推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
double: true,
一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
二级: {
"title": "h2&&Text;.deployment&&Text",
"img": ".lazy&&data-original",
"desc": ".deployment&&Text",
"content": ".ec-show&&Text",
"tabs": "#tag&&a",
"lists": ".play_list_box:eq(#id)&&li"
},
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
},
短视: {
title: '',
host: '',
// homeUrl:'/',
url: '/channel/fyclass-fypage.html',
searchUrl: '/search.html?wd=**',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent': 'MOBILE_UA',
// "Cookie": "searchneed=ok"
},
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
cate_exclude: '解析|动态',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
二级: {
"title": "h1&&Text;.content-rt&&p:eq(0)&&Text",
"img": ".img&&img&&data-src",
"desc": ".content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text",
"content": ".zkjj_a&&Text",
"tabs": ".py-tabs&&option",
"lists": ".player:eq(#id) li"
},
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
},
短视2:{
title: '',
host: '',
class_name:'电影&电视剧&综艺&动漫',
class_url:'1&2&3&4',
searchUrl: '/index.php/ajax/suggest?mid=1&wd=**&limit=50',
searchable: 2,
quickSearch: 0,
headers:{'User-Agent':'MOBILE_UA'},
url: '/index.php/api/vod#type=fyclass&page=fypage',
filterable:0,//是否启用分类筛选,
filter_url:'',
filter: {},
filter_def:{},
detailUrl:'/index.php/vod/detail/id/fyid.html',
play_parse: true,
lazy: '',
limit: 6,
推荐:'.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
一级:'js:let body=input.split("#")[1];let t=Math.round(new Date/1e3).toString();let key=md5("DS"+t+"DCC147D11943AF75");let url=input.split("#")[0];body=body+"&time="+t+"&key="+key;print(body);fetch_params.body=body;let html=post(url,fetch_params);let data=JSON.parse(html);VODS=data.list.map(function(it){it.vod_pic=urljoin2(input.split("/i")[0],it.vod_pic);return it});',
二级:{
"title":".slide-info-title&&Text;.slide-info:eq(3)--strong&&Text",
"img":".detail-pic&&data-original",
"desc":".fraction&&Text;.slide-info-remarks:eq(1)&&Text;.slide-info-remarks:eq(2)&&Text;.slide-info:eq(2)--strong&&Text;.slide-info:eq(1)--strong&&Text",
"content":"#height_limit&&Text",
"tabs":".anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a",
"tab_text":".swiper-slide&&Text",
"lists":".anthology-list-box:eq(#id) li"
},
搜索:'json:list;name;pic;;id',
}
};
return JSON.parse(JSON.stringify(mubanDict));
}
var mubanDict = getMubans();
var muban = getMubans();
export default {muban,getMubans};
if (typeof Object.assign != 'function') {
Object.assign = function () {
let target = arguments[0];
for (let i = 1; i < arguments.length; i++) {
let source = arguments[i];
for (let key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
}
function getMubans() {
var mubanDict = { // 模板字典
mx: {
title: '',
host: '',
url: '/vodshow/fyclass--------fypage---/',
searchUrl: '/vodsearch/**----------fypage---/',
class_parse: '.top_nav li;a&&Text;a&&href;.*/(.*?)/',
searchable: 2,
quickSearch: 0,
filterable: 0,
headers: {
'User-Agent': 'MOBILE_UA',
},
play_parse: true,
lazy: '',
limit: 6,
推荐: '.cbox_list;*;*;*;*;*',
double: true,
一级: 'ul.vodlist li;a&&title;a&&data-original;.pic_text&&Text;a&&href',
二级: {
title: 'h2&&Text;.detail_list&&ul:eq(1)&&li&&a:eq(2)&&Text',
img: '.vodlist_thumb&&data-original',
desc: '.content_detail&&li:eq(1)&&Text;.detail_list&&ul:eq(1)&&li&&a&&Text;.detail_list&&ul:eq(1)&&li&&a:eq(1)&&Text;.detail_list&&ul:eq(1)&&li:eq(2)&&Text;.detail_list&&ul:eq(1)&&li:eq(3)&&Text',
content: '.content_desc&&span&&Text',
tabs: '.play_source_tab&&a',
lists: '.content_playlist:eq(#id) li',
},
搜索: '*',
},
mxpro: {
title: '',
host: '', // homeUrl:'/',
url: '/vodshow/fyclass--------fypage---.html',
searchUrl: '/vodsearch/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
},
class_parse: '.navbar-items li:gt(2):lt(8);a&&Text;a&&href;/(\\d+).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href',
二级: {
"title": "h1&&Text;.module-info-tag&&Text",
"img": ".lazyload&&data-original",
"desc": ".module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text",
"content": ".module-info-introduction&&Text",
"tabs": ".module-tab-item",
"lists": ".module-play-list:eq(#id) a"
},
搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text',
}, mxone5: {
title: '',
host: '',
url: '/show/fyclass--------fypage---.html',
searchUrl: '/search/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
二级: {
"title": "h1&&Text;.tag-link&&Text",
"img": ".module-item-pic&&img&&data-src",
"desc": ".video-info-items:eq(0)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(2)&&Text;.video-info-items:eq(3)&&Text",
"content": ".vod_content&&Text",
"tabs": ".module-tab-item",
"lists": ".module-player-list:eq(#id)&&.scroll-content&&a"
},
搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
}, 首图: {
title: '',
host: '',
url: '/vodshow/fyclass--------fypage---/',
searchUrl: '/vodsearch/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
},
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(5);a&&Text;a&&href;/(\\d+).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
二级: {
"title": ".myui-content__detail .title&&Text;.myui-content__detail p:eq(-2)&&Text",
"img": ".myui-content__thumb .lazyload&&data-original",
"desc": ".myui-content__detail p:eq(0)&&Text;.myui-content__detail p:eq(1)&&Text;.myui-content__detail p:eq(2)&&Text",
"content": ".content&&Text",
"tabs": ".nav-tabs:eq(0) li",
"lists": ".myui-content__list:eq(#id) li"
},
搜索: '#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
}, 首图2: {
title: '',
host: '',
url: '/list/fyclass-fypage.html',
searchUrl: '/vodsearch/**----------fypage---.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {
'User-Agent': 'UC_UA', // "Cookie": ""
}, // class_parse:'.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
二级: {
"title": ".stui-content__detail .title&&Text;.stui-content__detail p:eq(-2)&&Text",
"img": ".stui-content__thumb .lazyload&&data-original",
"desc": ".stui-content__detail p:eq(0)&&Text;.stui-content__detail p:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text",
"content": ".detail&&Text",
"tabs": ".stui-vodlist__head h3",
"lists": ".stui-content__playlist:eq(#id) li"
},
搜索: 'ul.stui-vodlist__media:eq(0),ul.stui-vodlist:eq(0),#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
搜索1: 'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
搜索2: 'ul.stui-vodlist__media&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
}, 默认: {
title: '',
host: '',
url: '',
searchUrl: '',
searchable: 2,
quickSearch: 0,
filterable: 1,
filter: '',
filter_url: '',
filter_def: {},
headers: {
'User-Agent': 'MOBILE_UA',
},
timeout: 5000,
class_parse: '#side-menu li;a&&Text;a&&href;/(.*?)\.html',
cate_exclude: '',
play_parse: true,
lazy: `js:input = {parse: 1, url: input, js: ''}`,
double: true,
推荐: '列表1;列表2;标题;图片;描述;链接;详情',
一级: '列表;标题;图片;描述;链接;详情',
二级: {
title: 'vod_name;vod_type',
img: '图片链接',
desc: '主要信息;年代;地区;演员;导演',
content: '简介',
tabs: '',
lists: 'xx:eq(#id)&&a',
tab_text: 'body&&Text',
list_text: 'body&&Text',
list_url: 'a&&href'
},
搜索: '列表;标题;图片;描述;链接;详情',
}, vfed: {
title: '',
host: '',
url: '/index.php/vod/show/id/fyclass/page/fypage.html',
searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {
'User-Agent': 'UC_UA',
}, // class_parse:'.fed-pops-navbar&&ul.fed-part-rows&&a.fed-part-eone:gt(0):lt(5);a&&Text;a&&href;.*/(.*?).html',
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
play_parse: true,
lazy: '',
limit: 6,
推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
二级: {
"title": "h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text",
"img": ".fed-list-info&&a&&data-original",
"desc": ".fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text",
"content": ".fed-part-esan&&Text",
"tabs": ".fed-drop-boxs&&.fed-part-rows&&li",
"lists": ".fed-play-item:eq(#id)&&ul:eq(1)&&li"
},
搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
}, 海螺3: {
title: '',
host: '',
searchUrl: '/v_search/**----------fypage---.html',
url: '/vod_____show/fyclass--------fypage---.html',
headers: {
'User-Agent': 'MOBILE_UA'
},
timeout: 5000,
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
cate_exclude: '明星|专题|最新|排行',
limit: 40,
play_parse: true,
lazy: '',
推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
double: true,
一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
二级: {
"title": ".hl-infos-title&&Text;.hl-text-conch&&Text",
"img": ".hl-lazy&&data-original",
"desc": ".hl-infos-content&&.hl-text-conch&&Text",
"content": ".hl-content-text&&Text",
"tabs": ".hl-tabs&&a",
"lists": ".hl-plays-list:eq(#id)&&li"
},
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
}, 海螺2: {
title: '',
host: '',
searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
url: '/index.php/vod/show/id/fyclass/page/fypage/',
headers: {
'User-Agent': 'MOBILE_UA'
},
timeout: 5000,
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
limit: 40,
play_parse: true,
lazy: '',
推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
double: true,
一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
二级: {
"title": "h2&&Text;.deployment&&Text",
"img": ".lazy&&data-original",
"desc": ".deployment&&Text",
"content": ".ec-show&&Text",
"tabs": "#tag&&a",
"lists": ".play_list_box:eq(#id)&&li"
},
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
}, 短视: {
title: '',
host: '', // homeUrl:'/',
url: '/channel/fyclass-fypage.html',
searchUrl: '/search.html?wd=**',
searchable: 2,//是否启用全局搜索,
quickSearch: 0,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
},
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
cate_exclude: '解析|动态',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
double: true, // 推荐内容是否双层定位
一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
二级: {
"title": "h1&&Text;.content-rt&&p:eq(0)&&Text",
"img": ".img&&img&&data-src",
"desc": ".content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text",
"content": ".zkjj_a&&Text",
"tabs": ".py-tabs&&option",
"lists": ".player:eq(#id) li"
},
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
}, 短视2: {
title: '',
host: '',
class_name: '电影&电视剧&综艺&动漫',
class_url: '1&2&3&4',
searchUrl: '/index.php/ajax/suggest?mid=1&wd=**&limit=50',
searchable: 2,
quickSearch: 0,
headers: {'User-Agent': 'MOBILE_UA'},
url: '/index.php/api/vod#type=fyclass&page=fypage',
filterable: 0,//是否启用分类筛选,
filter_url: '',
filter: {},
filter_def: {},
detailUrl: '/index.php/vod/detail/id/fyid.html',
play_parse: true,
lazy: '',
limit: 6,
推荐: '.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
一级: 'js:let body=input.split("#")[1];let t=Math.round(new Date/1e3).toString();let key=md5("DS"+t+"DCC147D11943AF75");let url=input.split("#")[0];body=body+"&time="+t+"&key="+key;print(body);fetch_params.body=body;let html=post(url,fetch_params);let data=JSON.parse(html);VODS=data.list.map(function(it){it.vod_pic=urljoin2(input.split("/i")[0],it.vod_pic);return it});',
二级: {
"title": ".slide-info-title&&Text;.slide-info:eq(3)--strong&&Text",
"img": ".detail-pic&&data-original",
"desc": ".fraction&&Text;.slide-info-remarks:eq(1)&&Text;.slide-info-remarks:eq(2)&&Text;.slide-info:eq(2)--strong&&Text;.slide-info:eq(1)--strong&&Text",
"content": "#height_limit&&Text",
"tabs": ".anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a",
"tab_text": ".swiper-slide&&Text",
"lists": ".anthology-list-box:eq(#id) li"
},
搜索: 'json:list;name;pic;;id',
}, 采集1: {
title: '',
host: '',
homeTid: '13',
homeUrl: '/api.php/provide/vod/?ac=detail&t={{rule.homeTid}}',
detailUrl: '/api.php/provide/vod/?ac=detail&ids=fyid',
searchUrl: '/api.php/provide/vod/?wd=**&pg=fypage',
url: '/api.php/provide/vod/?ac=detail&pg=fypage&t=fyclass',
headers: {'User-Agent': 'MOBILE_UA'},
timeout: 5000, // class_name: '电影&电视剧&综艺&动漫',
// class_url: '1&2&3&4',
// class_parse:'js:let html=request(input);input=JSON.parse(html).class;',
class_parse: 'json:class;',
limit: 20,
multi: 1,
searchable: 2,//是否启用全局搜索,
quickSearch: 1,//是否启用快速搜索,
filterable: 0,//是否启用分类筛选,
play_parse: true,
parse_url: '',
lazy: `js:
if(/\\.(m3u8|mp4)/.test(input)){
input = {parse:0,url:input}
}else{
if(rule.parse_url.startsWith('json:')){
let purl = rule.parse_url.replace('json:','')+input;
let html = request(purl);
input = {parse:0,url:JSON.parse(html).url}
}else{
input= rule.parse_url+input;
}
}
`,
推荐: '*',
一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id;vod_play_from',
二级: `js:
let html=request(input);
html=JSON.parse(html);
let data=html.list;
VOD=data[0];`,
搜索: '*',
}
};
return JSON.parse(JSON.stringify(mubanDict));
}
var mubanDict = getMubans();
var muban = getMubans();
export default {muban, getMubans};