forked from dongg/tvbox
1 line
96 KiB
JavaScript
1 line
96 KiB
JavaScript
|
import cheerio from "assets://js/lib/cheerio.min.js"; import "assets://js/lib/crypto-js.js"; import 模板 from "./模板.js"; function init_test() { console.log("init_test_start"), console.log("当前版本号:" + VERSION), console.log(RKEY), console.log(JSON.stringify(rule)), console.log("init_test_end") } function pre() { if ("string" == typeof rule.预处理 && rule.预处理 && rule.预处理.trim()) { let code = rule.预处理.trim(); console.log("执行预处理代码:" + code), code.startsWith("js:") && (code = code.replace("js:", "")); try { eval(code) } catch (e) { console.log("预处理执行失败:" + e.message) } } } let rule = {}, vercode = "function" == typeof pdfl ? "drpy2.1" : "drpy2"; const VERSION = vercode + " 3.9.49beta2 20231122", 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", 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", UA = "Mozilla/5.0", UC_UA = "Mozilla/5.0 (Linux; U; Android 9; zh-CN; MI 9 Build/PKQ1.181121.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.5.1035 Mobile Safari/537.36", IOS_UA = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1", RULE_CK = "cookie", CATE_EXCLUDE = "首页|留言|APP|下载|资讯|新闻|动态", TAB_EXCLUDE = "猜你|喜欢|下载|剧情|热播", OCR_RETRY = 3, OCR_API = "http://drpy.nokia.press:8028/ocr/drpy/text"; var MY_URL, HOST, RKEY, fetch, print, log, rule_fetch_params, fetch_params, oheaders, _pdfh, _pdfa, _pd; const DOM_CHECK_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/, SPECIAL_URL = /^(ftp|magnet|thunder|ws):/, NOADD_INDEX = /:eq|:lt|:gt|:first|:last|^body$|^#/, URLJOIN_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/, SELECT_REGEX = /:eq|:lt|:gt|#/g, SELECT_REGEX_A = /:eq|:lt|:gt/g; function 是否正版(e) { return 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").test(e) } function urlDeal(e) { return e ? 是否正版(e) && !/miguvideo/.test(e) ? e.split("#")[0].split("?")[0] : e : "" } function setResult(e) { return Array.isArray(e) ? (VODS = [], e.forEach(function (e) { var a = { vod_id: e.url || "", vod_name: e.title || "", vod_remarks: e.desc || "", vod_content: e.content || "", vod_pic: e.pic_url || e.img || "" }, c = Object.keys(e); c.includes("tname") && (a.type_name = e.tname || ""), c.includes("tid") && (a.type_id = e.tid || ""), c.includes("year") && (a.vod_year = e.year || ""), c.includes("actor") && (a.vod_actor = e.actor || ""), c.includes("director") && (a.vod_director = e.director || ""), c.includes("area") && (a.vod_area = e.area || ""), VODS.push(a) }), VODS) : [] } function setResult2(e) { return VODS = e.list || [] } function setHomeResult(e) { return e && "object" == typeof e ? setResult(e.list) : [] } function rc(e) { var a, c; return "maomi_aes.js" === e ? (a = CryptoJS.enc.Utf8.parse("625222f9149e961d"), c = CryptoJS.enc.Utf8.parse("5efdtf6060e2o330"), { De: function (e) { return e = CryptoJS.enc.Hex.parse(e), CryptoJS.AES.decrypt(CryptoJS.enc.Base64.stringify(e), a, { iv: c, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }).toString(CryptoJS.enc.Utf8) }, En: function (e) { return CryptoJS.AES.encrypt(e, a, { iv: c, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }).ciphertext.toString() } }) : {} } function maoss(jxurl, ref, key) { fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)), eval(getCryptoJS()); try { var getVideoInfo = function (e) { return CryptoJS.AES.decrypt(e, key, { iv: iv, padding: CryptoJS.pad.Pkcs7 }).toString(CryptoJS.enc.Utf8) }, token_key = null == key ? "dvyYRQlnPRCMdQSe" : key, html, html, token_iv = (html = ref ? request(jxurl, { headers: { Referer: ref } }) : request(jxurl), -1 != html.indexOf("&btwaf=") && (html = requ
|