Add files via upload

This commit is contained in:
潇洒 2024-10-13 09:52:40 +08:00 committed by GitHub
parent b5449375c3
commit c234c394e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 10405 additions and 9493 deletions

4331
JS/cheerio.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,9 @@ import './node-rsa.js';
import './pako.min.js'; import './pako.min.js';
// import JSEncrypt from './jsencrypt.js'; // 会导致壳子崩溃的 // import JSEncrypt from './jsencrypt.js'; // 会导致壳子崩溃的
import 模板 from './模板.js' import 模板 from './模板.js'
import { gbkTool } from './gbk.js' import {
gbkTool
} from './gbk.js'
import './json5.js' import './json5.js'
// 下面是尝试对jinja2库进行更换 // 下面是尝试对jinja2库进行更换
import './jinja.js' import './jinja.js'
@ -450,7 +452,8 @@ function window_b64() {
*/ */
if (typeof atob !== 'function' || typeof btoa !== 'function') { if (typeof atob !== 'function' || typeof btoa !== 'function') {
var { var {
atob, btoa atob,
btoa
} = window_b64(); } = window_b64();
} }
@ -829,7 +832,8 @@ function Utf8ArrayToStr(array) {
char2 = array[i++]; char2 = array[i++];
char3 = array[i++]; char3 = array[i++];
out += String.fromCharCode( out += String.fromCharCode(
((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0)); ((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0)
);
break; break;
} }
} }
@ -3103,36 +3107,39 @@ function getOriginalJs(js_code) {
} }
let decode_funcs = [ let decode_funcs = [
(text) => { (text) => {
try { try {
return ungzip(text) return ungzip(text)
} catch (e) { } catch (e) {
logger('非gzip加密'); logger('非gzip加密');
return '' return ''
} }
}, (text) => { },
try { (text) => {
return base64Decode(text) try {
} catch (e) { return base64Decode(text)
logger('非b64加密'); } catch (e) {
return '' logger('非b64加密');
} return ''
}, (text) => { }
try { },
return aes_decrypt(text) (text) => {
} catch (e) { try {
logger('非aes加密'); return aes_decrypt(text)
return '' } catch (e) {
} logger('非aes加密');
}, (text) => { return ''
try { }
return RSA.decode(text, rsa_private_key, null) },
} catch (e) { (text) => {
logger('非rsa加密'); try {
return '' return RSA.decode(text, rsa_private_key, null)
} } catch (e) {
}, logger('非rsa加密');
// (text)=>{try {return NODERSA.decryptRSAWithPrivateKey(text, RSA.getPrivateKey(rsa_private_key).replace(/RSA /g,''), {options: {environment: "browser", encryptionScheme: 'pkcs1',b:'1024'}});} catch (e) {log(e.message);return ''}}, return ''
}
},
// (text)=>{try {return NODERSA.decryptRSAWithPrivateKey(text, RSA.getPrivateKey(rsa_private_key).replace(/RSA /g,''), {options: {environment: "browser", encryptionScheme: 'pkcs1',b:'1024'}});} catch (e) {log(e.message);return ''}},
] ]
let func_index = 0 let func_index = 0
while (!current_match.test(decode_content)) { while (!current_match.test(decode_content)) {
@ -3313,7 +3320,7 @@ function init(ext) {
rule.sniffer = false; rule.sniffer = false;
} }
rule.sniffer = rule.hasOwnProperty('sniffer') ? rule.sniffer : ''; rule.sniffer = rule.hasOwnProperty('sniffer') ? rule.sniffer : '';
rule.sniffer = !! (rule.sniffer && rule.sniffer !== '0' && rule.sniffer !== 'false'); rule.sniffer = !!(rule.sniffer && rule.sniffer !== '0' && rule.sniffer !== 'false');
rule.isVideo = rule.hasOwnProperty('isVideo') ? rule.isVideo : ''; rule.isVideo = rule.hasOwnProperty('isVideo') ? rule.isVideo : '';
if (rule.sniffer && !rule.isVideo) { // 默认辅助嗅探自动增强嗅探规则 if (rule.sniffer && !rule.isVideo) { // 默认辅助嗅探自动增强嗅探规则

97
JS/drpy2.min.js vendored
View File

@ -4,7 +4,9 @@ import "./jsencrypt.js";
import "./node-rsa.js"; import "./node-rsa.js";
import "./pako.min.js"; import "./pako.min.js";
import 模板 from "./模板.js"; import 模板 from "./模板.js";
import { gbkTool } from "./gbk.js"; import {
gbkTool
} from "./gbk.js";
import "./json5.js"; import "./json5.js";
import "./jinja.js"; import "./jinja.js";
const _jinja2 = cheerio.jinja2; const _jinja2 = cheerio.jinja2;
@ -25,12 +27,14 @@ function init_test() {
console.log(JSON.stringify(rule)); console.log(JSON.stringify(rule));
console.log("init_test_end") console.log("init_test_end")
} }
function ocr_demo_test() { 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=`; 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; OcrApi.api = OCR_API;
let code = OcrApi.classification(img_base64); let code = OcrApi.classification(img_base64);
log("测试验证码图片的ocr识别结果为:" + code) log("测试验证码图片的ocr识别结果为:" + code)
} }
function rsa_demo_test() { function rsa_demo_test() {
let t1 = (new Date).getTime(); let t1 = (new Date).getTime();
let pkcs1_public = ` let pkcs1_public = `
@ -184,6 +188,7 @@ m7mp8il0kaftHdSxTbspG3tZ2fjIiFIZkLEOmRpd7ogWumgOajzUdA==
let t2 = (new Date).getTime(); let t2 = (new Date).getTime();
console.log("rsa_demo_test 测试耗时:" + (t2 - t1) + "毫秒") console.log("rsa_demo_test 测试耗时:" + (t2 - t1) + "毫秒")
} }
function pre() { function pre() {
if (typeof rule.预处理 === "string" && rule.预处理 && rule.预处理.trim()) { if (typeof rule.预处理 === "string" && rule.预处理 && rule.预处理.trim()) {
let code = rule.预处理.trim(); let code = rule.预处理.trim();
@ -272,6 +277,7 @@ function window_b64() {
} }
return out return out
} }
function atob(str) { function atob(str) {
var c1, c2, c3, c4; var c1, c2, c3, c4;
var i, len, out; var i, len, out;
@ -312,7 +318,8 @@ function window_b64() {
} }
if (typeof atob !== "function" || typeof btoa !== "function") { if (typeof atob !== "function" || typeof btoa !== "function") {
var { var {
atob, btoa atob,
btoa
} = window_b64() } = window_b64()
} }
if (typeof Object.assign !== "function") { if (typeof Object.assign !== "function") {
@ -463,6 +470,7 @@ 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"); 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");
return flag.test(vipUrl) return flag.test(vipUrl)
} }
function urlDeal(vipUrl) { function urlDeal(vipUrl) {
if (!vipUrl) { if (!vipUrl) {
return "" return ""
@ -475,6 +483,7 @@ function urlDeal(vipUrl) {
} }
return vipUrl return vipUrl
} }
function setResult(d) { function setResult(d) {
if (!Array.isArray(d)) { if (!Array.isArray(d)) {
return [] return []
@ -511,16 +520,19 @@ function setResult(d) {
}); });
return VODS return VODS
} }
function setResult2(res) { function setResult2(res) {
VODS = res.list || []; VODS = res.list || [];
return VODS return VODS
} }
function setHomeResult(res) { function setHomeResult(res) {
if (!res || typeof res !== "object") { if (!res || typeof res !== "object") {
return [] return []
} }
return setResult(res.list) return setResult(res.list)
} }
function rc(js) { function rc(js) {
if (js === "maomi_aes.js") { if (js === "maomi_aes.js") {
var a = CryptoJS.enc.Utf8.parse("625222f9149e961d"); var a = CryptoJS.enc.Utf8.parse("625222f9149e961d");
@ -546,6 +558,7 @@ function rc(js) {
} }
return {} return {}
} }
function maoss(jxurl, ref, key) { function maoss(jxurl, ref, key) {
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
eval(getCryptoJS()); eval(getCryptoJS());
@ -588,10 +601,12 @@ function maoss(jxurl, ref, key) {
return "" return ""
} }
} }
function urlencode(str) { function urlencode(str) {
str = (str + "").toString(); str = (str + "").toString();
return encodeURIComponent(str).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A").replace(/%20/g, "+") return encodeURIComponent(str).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A").replace(/%20/g, "+")
} }
function encodeUrl(str) { function encodeUrl(str) {
if (typeof encodeURI == "function") { if (typeof encodeURI == "function") {
return encodeURI(str) return encodeURI(str)
@ -600,19 +615,24 @@ function encodeUrl(str) {
return encodeURIComponent(str).replace(/%2F/g, "/").replace(/%3F/g, "?").replace(/%3A/g, ":").replace(/%40/g, "@").replace(/%3D/g, "=").replace(/%3A/g, ":").replace(/%2C/g, ",").replace(/%2B/g, "+").replace(/%24/g, "$") return encodeURIComponent(str).replace(/%2F/g, "/").replace(/%3F/g, "?").replace(/%3A/g, ":").replace(/%40/g, "@").replace(/%3D/g, "=").replace(/%3A/g, ":").replace(/%2C/g, ",").replace(/%2B/g, "+").replace(/%24/g, "$")
} }
} }
function base64Encode(text) { function base64Encode(text) {
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(text)) return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(text))
} }
function base64Decode(text) { function base64Decode(text) {
return CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(text)) return CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(text))
} }
function md5(text) { function md5(text) {
return CryptoJS.MD5(text).toString() return CryptoJS.MD5(text).toString()
} }
function uint8ArrayToBase64(uint8Array) { function uint8ArrayToBase64(uint8Array) {
let binaryString = String.fromCharCode.apply(null, Array.from(uint8Array)); let binaryString = String.fromCharCode.apply(null, Array.from(uint8Array));
return btoa(binaryString) return btoa(binaryString)
} }
function Utf8ArrayToStr(array) { function Utf8ArrayToStr(array) {
var out, i, len, c; var out, i, len, c;
var char2, char3; var char2, char3;
@ -646,10 +666,12 @@ function Utf8ArrayToStr(array) {
} }
return out return out
} }
function gzip(str) { function gzip(str) {
let arr = pako.gzip(str, {}); let arr = pako.gzip(str, {});
return uint8ArrayToBase64(arr) return uint8ArrayToBase64(arr)
} }
function ungzip(b64Data) { function ungzip(b64Data) {
let strData = atob(b64Data); let strData = atob(b64Data);
const charData = strData.split("").map(function(x) { const charData = strData.split("").map(function(x) {
@ -659,6 +681,7 @@ function ungzip(b64Data) {
const data = pako.inflate(binData); const data = pako.inflate(binData);
return Utf8ArrayToStr(data) return Utf8ArrayToStr(data)
} }
function encodeStr(input, encoding) { function encodeStr(input, encoding) {
encoding = encoding || "gbk"; encoding = encoding || "gbk";
if (encoding.startsWith("gb")) { if (encoding.startsWith("gb")) {
@ -667,6 +690,7 @@ function encodeStr(input, encoding) {
} }
return input return input
} }
function decodeStr(input, encoding) { function decodeStr(input, encoding) {
encoding = encoding || "gbk"; encoding = encoding || "gbk";
if (encoding.startsWith("gb")) { if (encoding.startsWith("gb")) {
@ -675,6 +699,7 @@ function decodeStr(input, encoding) {
} }
return input return input
} }
function getCryptoJS() { function getCryptoJS() {
return 'console.log("CryptoJS已装载");' return 'console.log("CryptoJS已装载");'
} }
@ -735,6 +760,7 @@ function getProxyUrl() {
return "http://127.0.0.1:9978/proxy?do=js" return "http://127.0.0.1:9978/proxy?do=js"
} }
} }
function fixAdM3u8(m3u8_text, m3u8_url, ad_remove) { function fixAdM3u8(m3u8_text, m3u8_url, ad_remove) {
if (!m3u8_text && !m3u8_url || !m3u8_text && m3u8_url && !m3u8_url.startsWith("http")) { if (!m3u8_text && !m3u8_url || !m3u8_text && m3u8_url && !m3u8_url.startsWith("http")) {
return "" return ""
@ -789,6 +815,7 @@ function fixAdM3u8(m3u8_text, m3u8_url, ad_remove) {
m3u8_text = [m3u8_start, new_m3u8_body, m3u8_end].join("\n").trim(); m3u8_text = [m3u8_start, new_m3u8_body, m3u8_end].join("\n").trim();
return m3u8_text return m3u8_text
} }
function fixAdM3u8Ai(m3u8_url, headers) { function fixAdM3u8Ai(m3u8_url, headers) {
let ts = (new Date).getTime(); let ts = (new Date).getTime();
let option = headers ? { let option = headers ? {
@ -805,6 +832,7 @@ function fixAdM3u8Ai(m3u8_url, headers) {
} }
return i return i
} }
function reverseString(str) { function reverseString(str) {
return str.split("").reverse().join("") return str.split("").reverse().join("")
} }
@ -883,6 +911,7 @@ function fixAdM3u8Ai(m3u8_url, headers) {
log("处理耗时:" + ((new Date).getTime() - ts).toString()); log("处理耗时:" + ((new Date).getTime() - ts).toString());
return m3u8 return m3u8
} }
function forceOrder(lists, key, option) { function forceOrder(lists, key, option) {
let start = Math.floor(lists.length / 2); let start = Math.floor(lists.length / 2);
let end = Math.min(lists.length - 1, start + 1); let end = Math.min(lists.length - 1, start + 1);
@ -938,6 +967,7 @@ function getQuery(url) {
return {} return {}
} }
} }
function urljoin(fromPath, nowPath) { function urljoin(fromPath, nowPath) {
fromPath = fromPath || ""; fromPath = fromPath || "";
nowPath = nowPath || ""; nowPath = nowPath || "";
@ -969,6 +999,7 @@ function pdfh2(html, parse) {
} }
return result return result
} }
function pdfa2(html, parse) { function pdfa2(html, parse) {
let html2 = html; let html2 = html;
try { try {
@ -980,6 +1011,7 @@ function pdfa2(html, parse) {
} }
return defaultParser.pdfa(html2, parse) return defaultParser.pdfa(html2, parse)
} }
function pd2(html, parse, uri) { function pd2(html, parse, uri) {
let ret = pdfh2(html, parse); let ret = pdfh2(html, parse);
if (typeof uri === "undefined" || !uri) { if (typeof uri === "undefined" || !uri) {
@ -1028,7 +1060,8 @@ const parseTags = {
} }
} }
return "" return ""
}, pdfa(html, parse) { },
pdfa(html, parse) {
if (!parse || !parse.trim()) { if (!parse || !parse.trim()) {
return "" return ""
} }
@ -1044,7 +1077,8 @@ const parseTags = {
return ret[0] || [] return ret[0] || []
} }
return ret || [] return ret || []
}, pd(html, parse) { },
pd(html, parse) {
let ret = parseTags.json.pdfh(html, parse); let ret = parseTags.json.pdfh(html, parse);
if (ret) { if (ret) {
return urljoin(MY_URL, ret) return urljoin(MY_URL, ret)
@ -1060,7 +1094,8 @@ const parseTags = {
parse = parse.trim(); parse = parse.trim();
let result = defaultParser.pdfh(html, parse); let result = defaultParser.pdfh(html, parse);
return result return result
}, pdfa(html, parse) { },
pdfa(html, parse) {
if (!html || !parse || !parse.trim()) { if (!html || !parse || !parse.trim()) {
return [] return []
} }
@ -1068,7 +1103,8 @@ const parseTags = {
let result = defaultParser.pdfa(html, parse); let result = defaultParser.pdfa(html, parse);
print(`pdfa解析${parse}=>${result.length}`); print(`pdfa解析${parse}=>${result.length}`);
return result return result
}, pd(html, parse, base_url) { },
pd(html, parse, base_url) {
if (!html || !parse || !parse.trim()) { if (!html || !parse || !parse.trim()) {
return "" return ""
} }
@ -1103,6 +1139,7 @@ function readFile(filePath) {
console.log(text); console.log(text);
return text return text
} }
function dealJson(html) { function dealJson(html) {
try { try {
html = html.trim(); html = html.trim();
@ -1191,16 +1228,20 @@ function verifyCode(url) {
} }
return cookie return cookie
} }
function setItem(k, v) { function setItem(k, v) {
local.set(RKEY, k, v); local.set(RKEY, k, v);
console.log(`规则${RKEY}设置${k} => ${v}`) console.log(`规则${RKEY}设置${k} => ${v}`)
} }
function getItem(k, v) { function getItem(k, v) {
return local.get(RKEY, k) || v return local.get(RKEY, k) || v
} }
function clearItem(k) { function clearItem(k) {
local.delete(RKEY, k) local.delete(RKEY, k)
} }
function getHome(url) { function getHome(url) {
if (!url) { if (!url) {
return "" return ""
@ -1212,6 +1253,7 @@ function getHome(url) {
} catch (e) {} } catch (e) {}
return url return url
} }
function buildUrl(url, obj) { function buildUrl(url, obj) {
obj = obj || {}; obj = obj || {};
if (url.indexOf("?") < 0) { if (url.indexOf("?") < 0) {
@ -1229,9 +1271,11 @@ function buildUrl(url, obj) {
url += prs; url += prs;
return url return url
} }
function $require(url) { function $require(url) {
eval(request(url)) eval(request(url))
} }
function keysToLowerCase(obj) { function keysToLowerCase(obj) {
return Object.keys(obj).reduce((result, key) => { return Object.keys(obj).reduce((result, key) => {
const newKey = key.toLowerCase(); const newKey = key.toLowerCase();
@ -1239,6 +1283,7 @@ function keysToLowerCase(obj) {
return result return result
}, {}) }, {})
} }
function request(url, obj, ocr_flag) { function request(url, obj, ocr_flag) {
ocr_flag = ocr_flag || false; ocr_flag = ocr_flag || false;
if (typeof obj === "undefined" || !obj || obj === {}) { if (typeof obj === "undefined" || !obj || obj === {}) {
@ -1310,11 +1355,13 @@ function request(url, obj, ocr_flag) {
return html return html
} }
} }
function post(url, obj) { function post(url, obj) {
obj = obj || {}; obj = obj || {};
obj.method = "POST"; obj.method = "POST";
return request(url, obj) return request(url, obj)
} }
function reqCookie(url, obj, all_cookie) { function reqCookie(url, obj, all_cookie) {
obj = obj || {}; obj = obj || {};
obj.withHeaders = true; obj.withHeaders = true;
@ -1363,11 +1410,13 @@ function checkHtml(html, url, obj) {
} }
return html return html
} }
function getCode(url, obj) { function getCode(url, obj) {
let html = request(url, obj); let html = request(url, obj);
html = checkHtml(html, url, obj); html = checkHtml(html, url, obj);
return html return html
} }
function getHtml(url) { function getHtml(url) {
let obj = {}; let obj = {};
if (rule.headers) { if (rule.headers) {
@ -1394,6 +1443,7 @@ function getHtml(url) {
let html = getCode(url, obj); let html = getCode(url, obj);
return html return html
} }
function homeParse(homeObj) { function homeParse(homeObj) {
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let classes = []; let classes = [];
@ -1488,6 +1538,7 @@ function homeParse(homeObj) {
console.log(JSON.stringify(resp)); console.log(JSON.stringify(resp));
return JSON.stringify(resp) return JSON.stringify(resp)
} }
function getPP(p, pn, pp, ppn) { function getPP(p, pn, pp, ppn) {
try { try {
let ps = p[pn] === "*" && pp.length > ppn ? pp[ppn] : p[pn]; let ps = p[pn] === "*" && pp.length > ppn ? pp[ppn] : p[pn];
@ -1496,6 +1547,7 @@ function getPP(p, pn, pp, ppn) {
return "" return ""
} }
} }
function homeVodParse(homeVodObj) { function homeVodParse(homeVodObj) {
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let d = []; let d = [];
@ -1674,6 +1726,7 @@ function homeVodParse(homeVodObj) {
list: d list: d
}) })
} }
function categoryParse(cateObj) { function categoryParse(cateObj) {
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let p = cateObj.一级; let p = cateObj.一级;
@ -1838,6 +1891,7 @@ function categoryParse(cateObj) {
}); });
return vod return vod
} }
function searchParse(searchObj) { function searchParse(searchObj) {
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let d = []; let d = [];
@ -2013,6 +2067,7 @@ function searchParse(searchObj) {
list: d list: d
}) })
} }
function detailParse(detailObj) { function detailParse(detailObj) {
let t1 = (new Date).getTime(); let t1 = (new Date).getTime();
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
@ -2248,6 +2303,7 @@ function detailParse(detailObj) {
list: [vod] list: [vod]
}) })
} }
function get_tab_index(vod) { function get_tab_index(vod) {
let obj = {}; let obj = {};
vod.vod_play_from.split("$$$").forEach((it, index) => { vod.vod_play_from.split("$$$").forEach((it, index) => {
@ -2255,6 +2311,7 @@ function get_tab_index(vod) {
}); });
return obj return obj
} }
function vodDeal(vod) { function vodDeal(vod) {
let vod_play_from = vod.vod_play_from.split("$$$"); let vod_play_from = vod.vod_play_from.split("$$$");
let vod_play_url = vod.vod_play_url.split("$$$"); let vod_play_url = vod.vod_play_url.split("$$$");
@ -2286,6 +2343,7 @@ function vodDeal(vod) {
vod.vod_play_url = play_ordered_list.join("$$$"); vod.vod_play_url = play_ordered_list.join("$$$");
return vod return vod
} }
function tellIsJx(url) { function tellIsJx(url) {
try { try {
let is_vip = !/\.(m3u8|mp4|m4a)$/.test(url.split("?")[0]) && 是否正版(url); let is_vip = !/\.(m3u8|mp4|m4a)$/.test(url.split("?")[0]) && 是否正版(url);
@ -2294,6 +2352,7 @@ function tellIsJx(url) {
return 1 return 1
} }
} }
function playParse(playObj) { function playParse(playObj) {
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
MY_URL = playObj.url; MY_URL = playObj.url;
@ -2362,6 +2421,7 @@ function playParse(playObj) {
console.log(JSON.stringify(lazy_play)); console.log(JSON.stringify(lazy_play));
return JSON.stringify(lazy_play) return JSON.stringify(lazy_play)
} }
function proxyParse(proxyObj) { function proxyParse(proxyObj) {
var input = proxyObj.params; var input = proxyObj.params;
if (proxyObj.proxy_rule) { if (proxyObj.proxy_rule) {
@ -2380,6 +2440,7 @@ function proxyParse(proxyObj) {
return [404, "text/plain", "Not Found"] return [404, "text/plain", "Not Found"]
} }
} }
function isVideoParse(isVideoObj) { function isVideoParse(isVideoObj) {
var input = isVideoObj.url; var input = isVideoObj.url;
if (!isVideoObj.t) { if (!isVideoObj.t) {
@ -2399,6 +2460,7 @@ function isVideoParse(isVideoObj) {
} }
} }
} }
function getOriginalJs(js_code) { function getOriginalJs(js_code) {
let current_match = /var rule|[\u4E00-\u9FA5]+|function|let |var |const |\(|\)|"|'/; let current_match = /var rule|[\u4E00-\u9FA5]+|function|let |var |const |\(|\)|"|'/;
if (current_match.test(js_code)) { if (current_match.test(js_code)) {
@ -2433,24 +2495,21 @@ function getOriginalJs(js_code) {
logger("非gzip加密"); logger("非gzip加密");
return "" return ""
} }
}, }, text => {
text => {
try { try {
return base64Decode(text) return base64Decode(text)
} catch (e) { } catch (e) {
logger("非b64加密"); logger("非b64加密");
return "" return ""
} }
}, }, text => {
text => {
try { try {
return aes_decrypt(text) return aes_decrypt(text)
} catch (e) { } catch (e) {
logger("非aes加密"); logger("非aes加密");
return "" return ""
} }
}, }, text => {
text => {
try { try {
return RSA.decode(text, rsa_private_key, null) return RSA.decode(text, rsa_private_key, null)
} catch (e) { } catch (e) {
@ -2468,6 +2527,7 @@ function getOriginalJs(js_code) {
} }
return decode_content return decode_content
} }
function runMain(main_func_code, arg) { function runMain(main_func_code, arg) {
let mainFunc = function() { let mainFunc = function() {
return "" return ""
@ -2480,6 +2540,7 @@ function runMain(main_func_code, arg) {
return "" return ""
} }
} }
function init(ext) { function init(ext) {
console.log("init"); console.log("init");
rule = {}; rule = {};
@ -2603,7 +2664,7 @@ function init(ext) {
rule.sniffer = false rule.sniffer = false
} }
rule.sniffer = rule.hasOwnProperty("sniffer") ? rule.sniffer : ""; rule.sniffer = rule.hasOwnProperty("sniffer") ? rule.sniffer : "";
rule.sniffer = !! (rule.sniffer && rule.sniffer !== "0" && rule.sniffer !== "false"); rule.sniffer = !!(rule.sniffer && rule.sniffer !== "0" && rule.sniffer !== "false");
rule.isVideo = rule.hasOwnProperty("isVideo") ? rule.isVideo : ""; rule.isVideo = rule.hasOwnProperty("isVideo") ? rule.isVideo : "";
if (rule.sniffer && !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.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*"
@ -2677,6 +2738,7 @@ function home(filter, home_html, class_parse) {
}; };
return homeParse(homeObj) return homeParse(homeObj)
} }
function homeVod(params) { function homeVod(params) {
console.log("homeVod"); console.log("homeVod");
let homeVodObj = { let homeVodObj = {
@ -2687,6 +2749,7 @@ function homeVod(params) {
}; };
return homeVodParse(homeVodObj) return homeVodParse(homeVodObj)
} }
function category(tid, pg, filter, extend) { function category(tid, pg, filter, extend) {
let cateObj = { let cateObj = {
url: rule.url, url: rule.url,
@ -2698,6 +2761,7 @@ function category(tid, pg, filter, extend) {
}; };
return categoryParse(cateObj) return categoryParse(cateObj)
} }
function detail(vod_url) { function detail(vod_url) {
let orId = vod_url; let orId = vod_url;
let fyclass = ""; let fyclass = "";
@ -2727,6 +2791,7 @@ function detail(vod_url) {
}; };
return detailParse(detailObj) return detailParse(detailObj)
} }
function play(flag, id, flags) { function play(flag, id, flags) {
let playObj = { let playObj = {
url: id, url: id,
@ -2735,6 +2800,7 @@ function play(flag, id, flags) {
}; };
return playParse(playObj) return playParse(playObj)
} }
function search(wd, quick, pg) { function search(wd, quick, pg) {
if (rule.search_encoding) { if (rule.search_encoding) {
if (rule.search_encoding.toLowerCase() !== "utf-8") { if (rule.search_encoding.toLowerCase() !== "utf-8") {
@ -2752,6 +2818,7 @@ function search(wd, quick, pg) {
}; };
return searchParse(searchObj) return searchParse(searchObj)
} }
function proxy(params) { function proxy(params) {
if (rule.proxy_rule && rule.proxy_rule.trim()) { if (rule.proxy_rule && rule.proxy_rule.trim()) {
rule.proxy_rule = rule.proxy_rule.trim() rule.proxy_rule = rule.proxy_rule.trim()
@ -2765,6 +2832,7 @@ function proxy(params) {
}; };
return proxyParse(proxyObj) return proxyParse(proxyObj)
} }
function sniffer() { function sniffer() {
let enable_sniffer = rule.sniffer || false; let enable_sniffer = rule.sniffer || false;
if (enable_sniffer) { if (enable_sniffer) {
@ -2772,6 +2840,7 @@ function sniffer() {
} }
return enable_sniffer return enable_sniffer
} }
function isVideo(url) { function isVideo(url) {
let t = 0; let t = 0;
let is_video; let is_video;
@ -2793,9 +2862,11 @@ function isVideo(url) {
} }
return result return result
} }
function getRule(key) { function getRule(key) {
return key ? rule[key] || "" : rule return key ? rule[key] || "" : rule
} }
function DRPY() { function DRPY() {
return { return {
runMain: runMain, runMain: runMain,

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,9 @@
/*global require, exports, module, define */ /*global require, exports, module, define */
(function(global, factory) { (function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jinja = {})); typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jinja = {}));
})(this, (function(jinja) { })(this, (function(jinja) {
"use strict"; "use strict";
var STRINGS = /'(\\.|[^'])*'|"(\\.|[^"'"])*"/g; var STRINGS = /'(\\.|[^'])*'|"(\\.|[^"'"])*"/g;
@ -401,19 +403,20 @@
var _toString = Object.prototype.toString; var _toString = Object.prototype.toString;
var _hasOwnProperty = Object.prototype.hasOwnProperty; var _hasOwnProperty = Object.prototype.hasOwnProperty;
var getKeys = Object.keys || function(obj) { var getKeys = Object.keys || function(obj) {
var keys = []; var keys = [];
for (var n in obj) if (_hasOwnProperty.call(obj, n)) keys.push(n); for (var n in obj)
return keys; if (_hasOwnProperty.call(obj, n)) keys.push(n);
}; return keys;
};
var isArray = Array.isArray || function(obj) { var isArray = Array.isArray || function(obj) {
return _toString.call(obj) === '[object Array]'; return _toString.call(obj) === '[object Array]';
}; };
var create = Object.create || function(obj) { var create = Object.create || function(obj) {
function F() {} function F() {}
F.prototype = obj; F.prototype = obj;
return new F(); return new F();
}; };
var toString = function(val) { var toString = function(val) {
if (val == null) return ''; if (val == null) return '';
return (typeof val.toString == 'function') ? val.toString() : _toString.call(val); return (typeof val.toString == 'function') ? val.toString() : _toString.call(val);

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
(function(global, factory) { (function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.JSON5 = factory()); typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.JSON5 = factory());
}(this, (function() { }(this, (function() {
'use strict'; 'use strict';
@ -11,10 +13,11 @@
var _global = createCommonjsModule(function(module) { var _global = createCommonjsModule(function(module) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self var global = module.exports = typeof window != 'undefined' && window.Math == Math ?
// eslint-disable-next-line no-new-func window : typeof self != 'undefined' && self.Math == Math ? self
: // eslint-disable-next-line no-new-func
Function('return this')(); :
Function('return this')();
if (typeof __g == 'number') { if (typeof __g == 'number') {
__g = global; __g = global;
} // eslint-disable-line no-undef } // eslint-disable-line no-undef
@ -97,22 +100,23 @@
var dP = Object.defineProperty; var dP = Object.defineProperty;
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
_anObject(O); _anObject(O);
P = _toPrimitive(P, true); P = _toPrimitive(P, true);
_anObject(Attributes); _anObject(Attributes);
if (_ie8DomDefine) { if (_ie8DomDefine) {
try { try {
return dP(O, P, Attributes); return dP(O, P, Attributes);
} catch (e) { /* empty */} } catch (e) {
} /* empty */ }
if ('get' in Attributes || 'set' in Attributes) { }
throw TypeError('Accessors not supported!'); if ('get' in Attributes || 'set' in Attributes) {
} throw TypeError('Accessors not supported!');
if ('value' in Attributes) { }
O[P] = Attributes.value; if ('value' in Attributes) {
} O[P] = Attributes.value;
return O; }
}; return O;
};
var _objectDp = { var _objectDp = {
f: f f: f
@ -128,11 +132,11 @@
}; };
var _hide = _descriptors ? function(object, key, value) { var _hide = _descriptors ? function(object, key, value) {
return _objectDp.f(object, key, _propertyDesc(1, value)); return _objectDp.f(object, key, _propertyDesc(1, value));
} : function(object, key, value) { } : function(object, key, value) {
object[key] = value; object[key] = value;
return object; return object;
}; };
var hasOwnProperty = {}.hasOwnProperty; var hasOwnProperty = {}.hasOwnProperty;
var _has = function(it, key) { var _has = function(it, key) {
@ -306,7 +310,9 @@
return TO_STRING ? '' : undefined; return TO_STRING ? '' : undefined;
} }
a = s.charCodeAt(i); a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ?
TO_STRING ? s.charAt(i) : a :
TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
}; };
}; };
@ -331,7 +337,7 @@
var $fromCodePoint = String.fromCodePoint; var $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem // length should be 1, old FF problem
_export(_export.S + _export.F * ( !! $fromCodePoint && $fromCodePoint.length != 1), 'String', { _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints) // 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x) { fromCodePoint: function fromCodePoint(x) {
var arguments$1 = arguments; var arguments$1 = arguments;
@ -345,7 +351,10 @@
if (_toAbsoluteIndex(code, 0x10ffff) !== code) { if (_toAbsoluteIndex(code, 0x10ffff) !== code) {
throw RangeError(code + ' is not a valid code point'); throw RangeError(code + ' is not a valid code point');
} }
res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)); res.push(code < 0x10000 ?
fromCharCode(code) :
fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} }
return res.join(''); return res.join('');
} }
@ -371,12 +380,22 @@
isIdStartChar: function isIdStartChar(c) { isIdStartChar: function isIdStartChar(c) {
return typeof c === 'string' && ( return typeof c === 'string' && (
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c === '$') || (c === '_') || unicode.ID_Start.test(c)) (c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c === '$') || (c === '_') ||
unicode.ID_Start.test(c)
)
}, },
isIdContinueChar: function isIdContinueChar(c) { isIdContinueChar: function isIdContinueChar(c) {
return typeof c === 'string' && ( return typeof c === 'string' && (
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c === '$') || (c === '_') || (c === '') || (c === '') || unicode.ID_Continue.test(c)) (c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
(c === '$') || (c === '_') ||
(c === '\u200C') || (c === '\u200D') ||
unicode.ID_Continue.test(c)
)
}, },
isDigit: function isDigit(c) { isDigit: function isDigit(c) {
@ -526,12 +545,12 @@
case '\v': case '\v':
case '\f': case '\f':
case ' ': case ' ':
case ' ': case '\u00A0':
case '': case '\uFEFF':
case '\n': case '\n':
case '\r': case '\r':
case '': case '\u2028':
case '': case '\u2029':
read(); read();
return return
@ -611,8 +630,8 @@
switch (c) { switch (c) {
case '\n': case '\n':
case '\r': case '\r':
case '': case '\u2028':
case '': case '\u2029':
read(); read();
lexState = 'default'; lexState = 'default';
return return
@ -727,8 +746,8 @@
switch (c) { switch (c) {
case '$': case '$':
case '_': case '_':
case '': case '\u200C':
case '': case '\u200D':
buffer += read(); buffer += read();
return return
@ -756,8 +775,8 @@
switch (u) { switch (u) {
case '$': case '$':
case '_': case '_':
case '': case '\u200C':
case '': case '\u200D':
break break
default: default:
@ -986,8 +1005,8 @@
case '\r': case '\r':
throw invalidChar(read()) throw invalidChar(read())
case '': case '\u2028':
case '': case '\u2029':
separatorChar(c); separatorChar(c);
break break
@ -1162,8 +1181,8 @@
return unicodeEscape() return unicodeEscape()
case '\n': case '\n':
case '': case '\u2028':
case '': case '\u2029':
read(); read();
return '' return ''
@ -1482,8 +1501,8 @@
'\t': '\\t', '\t': '\\t',
'\v': '\\v', '\v': '\\v',
'\0': '\\0', '\0': '\\0',
'': '\\u2028', '\u2028': '\\u2028',
'': '\\u2029', '\u2029': '\\u2029',
}; };
if (replacements[c]) { if (replacements[c]) {
@ -1514,7 +1533,10 @@
var quote; var quote;
if ( if (
replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { replacer != null &&
typeof replacer === 'object' &&
!Array.isArray(replacer)
) {
space = replacer.space; space = replacer.space;
quote = replacer.quote; quote = replacer.quote;
replacer = replacer.replacer; replacer = replacer.replacer;
@ -1532,7 +1554,10 @@
if (typeof v === 'string') { if (typeof v === 'string') {
item = v; item = v;
} else if ( } else if (
typeof v === 'number' || v instanceof String || v instanceof Number) { typeof v === 'number' ||
v instanceof String ||
v instanceof Number
) {
item = String(v); item = String(v);
} }
@ -1624,8 +1649,8 @@
'\t': '\\t', '\t': '\\t',
'\v': '\\v', '\v': '\\v',
'\0': '\\0', '\0': '\\0',
'': '\\u2028', '\u2028': '\\u2028',
'': '\\u2029', '\u2029': '\\u2029',
}; };
var product = ''; var product = '';

File diff suppressed because it is too large Load Diff

957
JS/pako.min.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -424,5 +424,6 @@ function getMubans() {
var mubanDict = getMubans(); var mubanDict = getMubans();
var muban = getMubans(); var muban = getMubans();
export default { export default {
muban, getMubans muban,
getMubans
}; };