From a585001061ec5ca137b4907f558cb298b21d11db Mon Sep 17 00:00:00 2001 From: qist <87984115@qq.com> Date: Thu, 9 May 2024 10:42:34 +0800 Subject: [PATCH] update CAT --- cat/dist/index.js | 4 +-- cat/dist/index.js.md5 | 2 +- cat/tjs/18_tv_config.json | 2 +- cat/tjs/js/cntv.js | 55 ++++++++++++++++++++++++++------------- cat/tjs/js/testSpider.js | 37 +++++++++----------------- cat/tjs/js/wogg.js | 2 +- cat/tjs/tv_config.json | 2 +- 7 files changed, 55 insertions(+), 49 deletions(-) diff --git a/cat/dist/index.js b/cat/dist/index.js index e8d5ff75..444fd752 100644 --- a/cat/dist/index.js +++ b/cat/dist/index.js @@ -398,7 +398,7 @@ function print() { __p += __j.call(arguments, '') } `+i):l.stack=i}throw l}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=is(this.defaults,n);let{transitional:l,paramsSerializer:r,headers:i}=n;l!==void 0&&Sf.assertOptions(l,{silentJSONParsing:ua.transitional(ua.boolean),forcedJSONParsing:ua.transitional(ua.boolean),clarifyTimeoutError:ua.transitional(ua.boolean)},!1),r!=null&&(Z.isFunction(r)?n.paramsSerializer={serialize:r}:Sf.assertOptions(r,{encode:ua.function,serialize:ua.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&Z.merge(i.common,i[n.method]);i&&Z.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=s2.concat(s,i);let a=[],u=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(u=u&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});let o=[];this.interceptors.response.forEach(function(_){o.push(_.fulfilled,_.rejected)});let c,f=0,m;if(!u){let y=[wf.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,o),m=y.length,c=Promise.resolve(n);f{if(!l._listeners)return;let i=l._listeners.length;for(;i-- >0;)l._listeners[i](r);l._listeners=null}),this.promise.then=r=>{let i,s=new Promise(a=>{l.subscribe(a),i=a}).then(r);return s.cancel=function(){l.unsubscribe(i)},s},e(function(i,s,a){l.reason||(l.reason=new Dr(i,s,a),n(l.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new t(function(r){e=r}),cancel:e}}},hK=Gw;function Jw(t){return function(n){return t.apply(null,n)}}function Kw(t){return Z.isObject(t)&&t.isAxiosError===!0}var Xw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xw).forEach(([t,e])=>{Xw[e]=t});var mK=Xw;function yK(t){let e=new J6(t),n=P6(J6.prototype.request,e);return Z.extend(n,J6.prototype,e,{allOwnKeys:!0}),Z.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return yK(is(t,r))},n}var Jl=yK(P4);Jl.Axios=J6;Jl.CanceledError=Dr;Jl.CancelToken=hK;Jl.isCancel=M6;Jl.VERSION=_o;Jl.toFormData=ia;Jl.AxiosError=qe;Jl.Cancel=Jl.CanceledError;Jl.all=function(e){return Promise.all(e)};Jl.spread=Jw;Jl.isAxiosError=Kw;Jl.mergeConfig=is;Jl.AxiosHeaders=s2;Jl.formToJSON=t=>yf(Z.isHTMLForm(t)?new FormData(t):t);Jl.getAdapter=bf.getAdapter;Jl.HttpStatusCode=mK;Jl.default=Jl;var U4=Jl;var{Axios:KUe,AxiosError:XUe,CanceledError:WUe,isCancel:YUe,CancelToken:QUe,VERSION:ZUe,all:eMe,Cancel:tMe,isAxiosError:nMe,spread:lMe,toFormData:gK,AxiosHeaders:rMe,HttpStatusCode:iMe,formToJSON:sMe,getAdapter:aMe,mergeConfig:uMe}=U4;var xK=Ql(require("https"),1),AK=Ql(require("crypto"),1),OK=Ql(SK(),1),Qw={};globalThis.dataBase=null;globalThis.local={get:async function(t,e){return await _xe(t,e)},set:async function(t,e,n){await Exe(t,e,n)}};async function _xe(t,e){let n="/js_"+t+`/${e}/`;return await dataBase.getObjectDefault(n,{})}async function Exe(t,e,n){let l="/js_"+t;Qw=await dataBase.getObjectDefault(l,{}),Qw[e]=n,t==="log"&&await req("http://127.0.0.1:8099/upload",{data:{log:n+` `},timeout:.1}),await dataBase.push(l,Qw)}globalThis.localLog={set:async function(t,e,n){wxe(t,e,n)}};function bxe(){bo.default.existsSync("log")||bo.default.mkdirSync("log");let t="log/info.log";return bo.default.existsSync(t)?bo.default.readFileSync(t).toString():(bo.default.writeFileSync(t,""),"")}function wxe(t){bo.default.writeFileSync("log/info.log",bxe()+` `+t)}globalThis.req=Sxe;async function Sxe(t,e){try{let n=e&&e.data||null,l=e&&e.postType||null,r=e&&e.buffer||0,i=e&&e.timeout||5e3,s=(e&&e.redirect||1)===1,a=e.proxy??!1,u=e?e.headers||{}:{};l==="form"?(u["Content-Type"]="application/x-www-form-urlencoded",n!=null&&(n=TK.default.stringify(n,{encode:!1}))):l==="form-data"&&(u["Content-Type"]="multipart/form-data",n=gK(n));let o=r===1||r===2?"arraybuffer":void 0,c;a?c=OK.default.httpsOverHttp({proxy:{host:"127.0.0.1",port:7890}}):c=xK.default.Agent({rejectUnauthorized:!1});let f=await U4(t,{responseType:o,method:e&&e.method||"get",headers:u,data:n,timeout:i,maxRedirects:s?null:0,httpsAgent:c});n=f.data;let m={};for(let d of f.headers){let y=d[1];m[d[0]]=Array.isArray(y)&&y.length===1?y[0]:y}if(!r)typeof n=="object"&&(n=JSON.stringify(n));else{if(r===1)return{code:f.status,headers:m,content:n};if(r===2)return{code:f.status,headers:m,content:n.toString("base64")};if(r===3){let d=e.stream;return d.onResp&&await d.onResp({code:f.status,headers:m}),d.onData?(n.on("data",async y=>{await d.onData(y)}),n.on("end",async()=>{d.onDone&&await d.onDone()})):d.onDone&&await d.onDone(),"stream..."}}return{code:f.status,headers:m,content:n}}catch(n){let l=n.response;try{return{code:l.status,headers:l.headers,content:JSON.stringify(l.data)}}catch{return{headers:{},content:""}}}}globalThis.md5X=Txe;function Txe(t){return AK.default.createHash("md5").update(Buffer.from(t,"utf8")).digest("hex")}globalThis.js2Proxy=function(t,e,n){let l=Object.keys(n).length===0?" ":encodeURIComponent(JSON.stringify(n));return t.server.address().dynamic+t.server.prefix+"/proxy/"+encodeURIComponent(e)+"/"+l+"/"};var xxe=["DEBUG","INFO","WARNING","ERROR"];var $4=class{constructor(e,n="DEBUG"){this.app_name=e,this.level=n,this.level_index=xxe.indexOf(n)}format(e,n){let l=80;switch(e){case"INFO":l=l+1;break;case"WARNING":l=l-2;break;default:break}return n.length0?!0:(await this.db.push(this.deviceKey+"classes",{}),await this.db.push(this.deviceKey+"filterObj",{}),!1)}async writeFilterAndClasses(){this.catOpenStatus&&this.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await this.setClasses(),await this.setFilterObj(),await this.db.push(this.deviceKey+"classes",this.classes),await this.db.push(this.deviceKey+"filterObj",this.filterObj)}async getClassesCache(){let e=await this.db.getObjectDefault(this.deviceKey+"classes",{});return B.isEmpty(e)?this.classes:e}async getFiletObjCache(){let e=await this.db.getObjectDefault(this.deviceKey+"filterObj",{});return B.isEmpty(e)?this.filterObj:e}async home(e,n){return this.vodList=[],await this.jadeLog.info("\u6B63\u5728\u89E3\u6790\u9996\u9875\u7C7B\u522B",!0),await this.setHome(),await this.jadeLog.debug(`\u9996\u9875\u7C7B\u522B\u5185\u5BB9\u4E3A:${this.result.home(this.classes,[],this.filterObj)}`),await this.jadeLog.info("\u9996\u9875\u7C7B\u522B\u89E3\u6790\u5B8C\u6210",!0),this.result.home(this.classes,[],this.filterObj)}async homeVod(){await this.jadeLog.info("\u6B63\u5728\u89E3\u6790\u9996\u9875\u5185\u5BB9",!0);try{return await this.setHomeVod(),await this.jadeLog.debug(`\u9996\u9875\u5185\u5BB9\u4E3A:${this.result.homeVod(this.homeVodList)}`),await this.jadeLog.info("\u9996\u9875\u5185\u5BB9\u89E3\u6790\u5B8C\u6210",!0),this.result.homeVod(this.homeVodList)}catch(e){await this.jadeLog.error(`\u9996\u9875\u5185\u5BB9\u89E3\u6790\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${e}`)}}async category(e,n){let l=e.body.id,r=e.body.page,i=!0,s=e.body.filters;if(this.page=parseInt(r),await this.jadeLog.info(`\u6B63\u5728\u89E3\u6790\u5206\u7C7B\u9875\u9762,tid = ${l},pg = ${r},extend = ${JSON.stringify(s)}`),l==="\u6700\u8FD1\u66F4\u65B0")return this.page=0,await this.homeVod();try{return this.vodList=[],await this.setCategory(l,r,i,s),await this.jadeLog.debug(`\u5206\u7C7B\u9875\u9762\u5185\u5BB9\u4E3A:${this.result.category(this.vodList,this.page,this.count,this.limit,this.total)}`),await this.jadeLog.info("\u5206\u7C7B\u9875\u9762\u89E3\u6790\u5B8C\u6210",!0),this.result.category(this.vodList,this.page,this.count,this.limit,this.total)}catch(a){await this.jadeLog.error(`\u5206\u7C7B\u9875\u89E3\u6790\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${a}`)}}async detail(e,n){await this.jadeLog.debug(`\u83B7\u53D6\u8BE6\u60C5\u9875\u9762:${JSON.stringify(e.body)}`);let r=(Array.isArray(e.body.id)?e.body.id:[e.body.id])[0];this.vodDetail=new Me,await this.jadeLog.info(`\u6B63\u5728\u83B7\u53D6\u8BE6\u60C5\u9875\u9762,id\u4E3A:${r}`);try{return await this.setDetail(r),await this.jadeLog.debug(`\u8BE6\u60C5\u9875\u9762\u5185\u5BB9\u4E3A:${this.result.detail(this.vodDetail)}`),await this.jadeLog.info("\u8BE6\u60C5\u9875\u9762\u89E3\u6790\u5B8C\u6210",!0),this.vodDetail.vod_id=r,this.result.detail(this.vodDetail)}catch(i){await this.jadeLog.error("\u8BE6\u60C5\u754C\u9762\u83B7\u53D6\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:"+i)}}async play(e,n){let l=e.body.flag,r=e.body.id,i=[];await this.jadeLog.info(`\u6B63\u5728\u89E3\u6790\u64AD\u653E\u9875\u9762,flag:${l},id:${r},flags:${i}`,!0);try{let s;if(await this.setPlay(l,r,i),this.playUrl.content!==void 0)return this.playUrl;if(await this.jadeLog.debug("\u4E0D\u9700\u8981\u52A0\u8F7D\u5F39\u5E55",!0),this.result.jx===1&&this.playUrl.indexOf(".m3u8")<0){let a=await e.server.messageToDart({action:"sniff",opt:{url:r,timeout:6e4,rule:"http((?!http).){12,}?\\.m3u8?"}});if(a&&a.url){let u={};a.headers&&(a.headers["user-agent"]&&(u["User-Agent"]=a.headers["user-agent"]),a.headers.referer&&(u.Referer=a.headers.referer)),await this.jadeLog.debug(`\u55C5\u63A2\u6210\u529F,\u64AD\u653E\u8FDE\u63A5\u4E3A:${a.url}`),s=JSON.stringify({parse:0,url:a.url,header:a.headers,jx:"0"})}else await this.jadeLog.error("\u89E3\u6790\u5931\u8D25,\u65E0\u6CD5\u55C5\u63A2\u5230\u64AD\u653E\u8FDE\u63A5"),s=JSON.stringify({parse:0,url:"",jx:"0"})}else s=this.result.play(this.playUrl);return await this.jadeLog.info("\u64AD\u653E\u9875\u9762\u89E3\u6790\u5B8C\u6210",!0),await this.jadeLog.debug(`\u64AD\u653E\u9875\u9762\u5185\u5BB9\u4E3A:${s}`),s}catch(s){await this.jadeLog.error("\u89E3\u6790\u64AD\u653E\u9875\u9762\u51FA\u9519,\u5931\u8D25\u539F\u56E0\u4E3A:"+s)}}async search(e,n){let l=e.body.page,r=e.body.wd,i=!0;return this.vodList=[],await this.jadeLog.info(`\u6B63\u5728\u89E3\u6790\u641C\u7D22\u9875\u9762,\u5173\u952E\u8BCD\u4E3A = ${r},quick = ${i},pg = ${l}`),await this.setSearch(r,i,l),this.vodList.length===0&&r.indexOf(" ")>-1&&(await this.jadeLog.debug(`\u641C\u7D22\u5173\u952E\u8BCD\u4E3A:${r},\u5176\u4E2D\u6709\u7A7A\u683C,\u53BB\u9664\u7A7A\u683C\u5728\u641C\u7D22\u4E00\u6B21`),await this.search(r.replaceAll(" ","").replaceAll("?",""),i)),await this.jadeLog.debug(`\u641C\u7D22\u9875\u9762\u5185\u5BB9\u4E3A:${this.result.search(this.vodList)}`),await this.jadeLog.info("\u641C\u7D22\u9875\u9762\u89E3\u6790\u5B8C\u6210",!0),this.result.search(this.vodList)}async proxy(e,n){try{let l=e.params.what,r={};try{r=JSON.parse(e.params.ids)}catch{}let i=decodeURIComponent(e.params.end),s=JSON.parse(await this.setProxy([l,i],r));return l==="dash"?(await this.jadeLog.debug(`dash:${JSON.stringify(s)}`),n.code(s.code).headers(s.headers),s.content):s.code===200?(n.code(s.code).headers(s.headers),Buffer.from(s.content,"base64")):(n.code(500),"")}catch(l){await this.jadeLog.error(`\u4EE3\u7406\u56DE\u8C03\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${l}`)}}};var ca=class extends Pe{constructor(){super(),this.siteUrl="http://cj.ffzyapi.com",this.remove18=!1,this.type_id_18=34}async spiderInit(e){e!==null?this.detailProxy=await js2Proxy(e,"detail",this.getHeader()):this.detailProxy=await js2Proxy(!0,this.siteType,this.siteKey,"detail/",this.getHeader())}async init(e){await super.init(e),await this.spiderInit(null)}async parseVodShortListFromJson(e,n=!1){let l=[],r;for(let i of e.list)n?(r=new Ne,r.vod_pic=this.detailProxy+n2(i.vod_id),r.vod_id=i.vod_id,r.vod_name=i.vod_name,r.vod_remarks=i.vod_remarks):r=this.parseVodDetail(i),this.remove18&&i.type_id!==this.type_id_18&&l.push(r),!this.remove18&&i.type_id===this.type_id_18&&l.push(r);return l}parseVodDetail(e){let n=new Me;n.vod_id=e.vod_id,n.vod_name=e.vod_name,n.vod_pic=e.vod_pic,n.vod_remarks=e.vod_remarks,n.vod_area=e.vod_area,n.vod_year=e.vod_year,n.vod_actor=e.vod_actor,n.vod_director=e.vod_director;let l=Ue(e.vod_content);return n.vod_content=l.text(),e.vod_down_url!==void 0&&e.vod_down_url.length>0&&(n.vod_play_from="\u76F4\u94FE\u64AD\u653E$$$",n.vod_play_url=e.vod_down_url+"$$$"),n.vod_play_from=n.vod_play_from+e.vod_play_from,n.vod_play_url=n.vod_play_url+e.vod_play_url,n.type_name=e.type_name,n}async parseVodDetailfromJson(e){let n,l=e.list;if(l.length>0){let r=l[0];n=this.parseVodDetail(r)}return n}async setClasses(){let e=await this.fetch(this.siteUrl+"/api.php/provide/vod/from",{ac:"list"},this.getHeader()),n=JSON.parse(e);for(let l of n.class)l.type_pid!==0&&this.classes.push(this.getTypeDic(l.type_name,l.type_id))}async setFilterObj(){let e=await this.fetch(this.siteUrl+"/api.php/provide/vod/from",{ac:"list"},this.getHeader()),n=JSON.parse(e);for(let l of this.classes){let r=l.type_id.toString();if(r!=="\u6700\u8FD1\u66F4\u65B0"){let i={key:"1",name:"\u5206\u7C7B",value:[{n:"\u5168\u90E8",v:r}]};for(let s of n.class){let a=s.type_name;a===this.type_name_18&&(this.type_id_18=s.type_id.toString()),this.remove18?s.type_pid===l.type_id&&a!==this.type_name_18&&i.value.push({n:a,v:s.type_id.toString()}):s.type_pid===l.type_id&&a===this.type_name_18&&i.value.push({n:a,v:s.type_id.toString()})}this.remove18?this.filterObj[r]=[i]:this.classes=[this.getTypeDic("\u6700\u8FD1\u66F4\u65B0","\u6700\u8FD1\u66F4\u65B0"),this.getTypeDic(this.type_name_18,this.type_id_18)]}}}async setHomeVod(){let e=await this.fetch(this.siteUrl+"/index.php/ajax/data",{mid:"1"},this.getHeader());this.homeVodList=await this.parseVodShortListFromJson(JSON.parse(e))}async setDetail(e){let n=await this.fetch(this.siteUrl+"/api.php/provide/vod",{ac:"detail",ids:e},this.getHeader());this.vodDetail=await this.parseVodDetailfromJson(JSON.parse(n))}async setCategory(e,n,l,r){e=r[1]??e;let i=this.siteUrl+`/index.php/ajax/data?mid=1&tid=${e}&page=${n}&limit=20`;await this.jadeLog.debug(`\u5206\u7C7BURL:${i}`);let s=await this.fetch(i,null,this.getHeader());await this.jadeLog.debug(`\u5206\u7C7B\u5185\u5BB9\u4E3A:${s}`),this.vodList=await this.parseVodShortListFromJson(JSON.parse(s))}async setSearch(e,n){let l=await this.fetch(this.siteUrl+"/api.php/provide/vod/",{wd:e},this.getHeader());this.vodList=await this.parseVodShortListFromJson(JSON.parse(l),!0)}async proxy(e,n){await this.jadeLog.debug(`\u6B63\u5728\u8BBE\u7F6E\u53CD\u5411\u4EE3\u7406 segments = ${e.join(",")},headers = ${JSON.stringify(n)}`);let l=e[0],r=_2(e[1]);if(await this.jadeLog.debug(`\u53CD\u5411\u4EE3\u7406\u53C2\u6570\u4E3A:${r}`),l==="detail"){let i=await this.fetch(this.siteUrl+"/api.php/provide/vod",{ac:"detail",ids:r},this.getHeader()),s=await this.parseVodDetailfromJson(JSON.parse(i)),a=await this.fetch(s.vod_pic,null,this.getHeader(),!1,!1,2);return B.isEmpty(a)?JSON.stringify({code:500,buffer:2,content:"",headers:{}}):JSON.stringify({code:200,buffer:2,content:a,headers:{}})}}};var Zw=class extends ca{constructor(){super(),this.siteUrl="https://haiwaikan.com",this.remove18=!0,this.type_id_18=0}async spiderInit(e){await super.spiderInit(e)}async init(e){await super.init(e),await this.spiderInit(null)}getAppName(){return"\u6D77\u5916\u770B"}getName(){return"\u2615\u2503\u6D77\u5916\u770B\u2503\u2615\u5899"}getJSName(){return"haiwaikan"}getType(){return 3}async setClasses(){let e=await this.fetch(this.siteUrl+"/api.php/provide/vod/from",{ac:"list"},this.getHeader()),n=JSON.parse(e);for(let l of n.class)l.type_id<26&&this.classes.push(this.getTypeDic(l.type_name,l.type_id.toString()));this.content_json=n}async getFilter(e,n){let l=[],r={key:"1",name:"\u5168\u90E8\u7C7B\u522B",value:[{n:"\u5168\u90E8\u7C7B\u522B",v:e.toString()}]};for(let i of n.class){let s=i.type_id,a=0,u=0;e===20&&(a=50,u=27),e===21&&(a=128,u=100),e===22&&(a=143,u=134),e===23&&(a=135,u=127),su&&r.value.push({n:i.type_name,v:s.toString()})}return r.value.length>1?(l.push(r),l):null}async setFilterObj(){let e=await this.fetch(this.siteUrl+"/api.php/provide/vod/from",{ac:"list"},this.getHeader()),n=JSON.parse(e);for(let l of this.classes){let r=l.type_id;if(r!=="\u6700\u8FD1\u66F4\u65B0"){let i=await this.getFilter(parseInt(r),n);i!==null&&(this.filterObj[r]=i)}}}},yn=new Zw;var eS=class extends Ce{constructor(){super()}getName(){return yn.getName()}getAppName(){return yn.getAppName()}getJSName(){return yn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await yn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await yn.initCookie(e.server.config.bilicookie),await yn.spiderInit(e),yn.cfgObj.code=0,yn.catOpenStatus=!0,yn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await yn.setClasses(),this.classes=yn.classes}async setFilterObj(){await yn.setFilterObj(),this.filterObj=yn.filterObj}async setHomeVod(){await yn.setHomeVod(),this.homeVodList=yn.homeVodList}async setCategory(e,n,l,r){await yn.setCategory(e,n,l,r),this.vodList=yn.vodList}async setDetail(e){await yn.setDetail(e),this.vodDetail=yn.vodDetail}async setPlay(e,n,l){await yn.setPlay(e,n,l),this.playUrl=yn.playUrl,this.result=yn.result}async setSearch(e,n,l){await yn.setSearch(e,n,l),this.vodList=yn.vodList,this.result=yn.result}async setProxy(e,n){return await yn.proxy(e,n)}},pa=new eS;async function NK(t,e){return await pa.init(t,e)}async function CK(t,e){return await pa.home(t,e)}async function Axe(t,e){return await pa.homeVod(t,e)}async function RK(t,e){return await pa.category(t,e)}async function IK(t,e){return await pa.detail(t,e)}async function kK(t,e){return await pa.play(t,e)}async function DK(t,e){return await pa.search(t,e)}async function Oxe(t,e){return await pa.proxy(t,e)}var PK={meta:{key:yn.getJSName(),name:yn.getName(),type:yn.getType()},api:async t=>{t.post("/init",NK),t.post("/home",CK),t.post("/category",RK),t.post("/detail",IK),t.post("/play",kK),t.post("/search",DK),t.get("/proxy/:what/:ids/:end",Oxe)},spider:{init:NK,home:CK,homeVod:Axe,category:RK,detail:IK,play:kK,search:DK}};function Tf(t,e){let n=xf();return Tf=function(l,r){return l=l-424,n[l]},Tf(t,e)}function xf(){let t=["1580630GngmmA","117uvwflw","join","current_id","565448Apkhig","23092JwmytW","707152yowhOv","getElementById","855936CGaczt","length","2966831GCGpvn","611266nfcTEf","value","substring"];return xf=function(){return t},xf()}(function(t,e){let n=Tf,l=t();for(;;)try{if(-parseInt(n(436))/1+parseInt(n(429))/2+-parseInt(n(433))/3*(-parseInt(n(437))/4)+-parseInt(n(432))/5+parseInt(n(426))/6+parseInt(n(428))/7+parseInt(n(424))/8===e)break;l.push(l.shift())}catch{l.push(l.shift())}})(xf,304089);function Nxe(t,e){let n=Tf,l=t,r=e;if(!l||!r)return;let i=l.length,s=l[n(431)](i-4,i),a=[];for(let u=0;u .meta"),l=new Me;l.vod_pic=this.jsBase+n2(e("div.item-root > img")[0].attribs["data-src"]),l.vod_name=this.getChildren(n,0),l.vod_year=this.getChildren(n,1),l.vod_area=this.getChildren(n,3),l.vod_actor=this.getChildren(n,4);let r=we(/ div.media-left > a");for(let r of l){let i=new Ne,s=e(r).find("img:first")[0];i.vod_id=r.attribs.href,i.vod_name=s.attribs.alt,i.vod_pic=this.jsBase+n2(s.attribs["data-src"]),n.push(i)}return n}async setClasses(){let e=await this.fetch(this.siteUrl+"/category",null,this.getHeader());if(!B.isEmpty(e)){let n=Ue(e),l=n(n(n('[class="row visible-xs-block visible-sm-block"]')).find("li")).find("a");for(let r of l)this.classes.push({type_name:n(r).text(),type_id:r.attribs.href})}}async setFilterObj(){for(let e of this.classes.slice(1,9)){let n=e.type_id;if(n.indexOf("category")===-1||n.indexOf(",")>-1){let l=n.split(",").slice(-1)[0],r=await this.fetch(this.siteUrl+l,null,this.getHeader());if(!B.isEmpty(r)){let i=Ue(r),s=i('[class="row visible-xs-block visible-sm-block"]'),a=s.find('[class="nav nav-pills"]').find("a"),u=[];n.indexOf(",")>-1&&u.push({n:"\u5168\u90E8",v:n.split(",")[0]});let o={key:n,name:i(s.find("h5")).text(),value:u};for(let c of a)u.push({n:i(c).text(),v:c.attribs.href});u.length>0&&(this.filterObj[n]=[o])}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(e)){let n=Ue(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}async setCategory(e,n,l,r){let i=this.siteUrl+(r[e]||e.split(",")[0]),s=!1;i.indexOf("html")>-1?i=i.replace(".html",n>1?`-p-${n}.html`:".html"):(i=i+`?p=${n}`,s=!0),await this.jadeLog.debug(`\u5206\u7C7BURL:${i}`);let a=await this.fetch(i,null,this.getHeader());if(!B.isEmpty(a)){let u=Ue(a);this.vodList=await this.parseVodShortListFromDoc(u);let o=u("div.page-more > a:contains(\u4E0B\u4E00\u9875)");s&&(this.page=parseInt(o[0].attribs.href.split("p=")[1]));let c=o.length>0;this.limit=24,this.count=c?parseInt(n)+1:parseInt(n),this.total=this.limit*this.count}}async setDetail(e){let n=await this.fetch(this.siteUrl+e,null,this.getHeader());if(!B.isEmpty(n)){let l=Ue(n);this.vodDetail=await this.parseVodDetailFromDoc(l)}}async setSearch(e,n){let l=await this.fetch(this.siteUrl+"/search?q="+e,null,this.getHeader());if(!B.isEmpty(l)){let r=Ue(l);this.vodList=await this.parseVodShortListFromDocBySearch(r)}}async setPlay(e,n,l){this.playUrl=n}},gn=new tS;var nS=class extends Ce{constructor(){super()}getName(){return gn.getName()}getAppName(){return gn.getAppName()}getJSName(){return gn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await gn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await gn.initCookie(e.server.config.bilicookie),await gn.spiderInit(e),gn.cfgObj.code=0,gn.catOpenStatus=!0,gn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await gn.setClasses(),this.classes=gn.classes}async setFilterObj(){await gn.setFilterObj(),this.filterObj=gn.filterObj}async setHomeVod(){await gn.setHomeVod(),this.homeVodList=gn.homeVodList}async setCategory(e,n,l,r){await gn.setCategory(e,n,l,r),this.vodList=gn.vodList}async setDetail(e){await gn.setDetail(e),this.vodDetail=gn.vodDetail}async setPlay(e,n,l){await gn.setPlay(e,n,l),this.playUrl=gn.playUrl,this.result=gn.result}async setSearch(e,n,l){await gn.setSearch(e,n,l),this.vodList=gn.vodList,this.result=gn.result}async setProxy(e,n){return await gn.proxy(e,n)}},fa=new nS;async function LK(t,e){return await fa.init(t,e)}async function FK(t,e){return await fa.home(t,e)}async function Cxe(t,e){return await fa.homeVod(t,e)}async function jK(t,e){return await fa.category(t,e)}async function UK(t,e){return await fa.detail(t,e)}async function MK(t,e){return await fa.play(t,e)}async function $K(t,e){return await fa.search(t,e)}async function Rxe(t,e){return await fa.proxy(t,e)}var BK={meta:{key:gn.getJSName(),name:gn.getName(),type:gn.getType()},api:async t=>{t.post("/init",LK),t.post("/home",FK),t.post("/category",jK),t.post("/detail",UK),t.post("/play",MK),t.post("/search",$K),t.get("/proxy/:what/:ids/:end",Rxe)},spider:{init:LK,home:FK,homeVod:Cxe,category:jK,detail:UK,play:MK,search:$K}};var lS=class extends Pe{constructor(){super(),this.siteUrl="https://ali.gitcafe.ink"}getName(){return"\u{1F98A}\u2503\u963F\u91CC\u7EB8\u6761\u2503\u{1F98A}"}getAppName(){return"\u963F\u91CC\u7EB8\u6761"}getJSName(){return"gitcafe"}getType(){return 3}async getApiUrl(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(e)){let n=we(/