import{Crypto,dayjs,jinja2,_}from"assets://js/lib/cat.js";let key="kkys",url="https://api1.baibaipei.com:8899",device={},siteKey="",siteType=0;async function request(reqUrl,postData,agentSp,get){var ts=dayjs().valueOf().toString(),rand=randStr(32),sign=Crypto.MD5("abcdexxxdd2daklmn25129_"+ts+"_"+rand).toString().toLowerCase(),agentSp={"user-agent":agentSp||device.ua},sign=(reqUrl.includes("baibaipei")&&(agentSp["device-id"]=device.id,agentSp["push-token"]="",agentSp.sign=sign,agentSp.time=ts,agentSp.md5=rand,agentSp.version="2.1.3",agentSp["system-model"]=device.model,agentSp["system-brand"]=device.brand,agentSp["system-version"]=device.release),await req(reqUrl,{method:get?"get":"post",headers:agentSp,data:postData||{},postType:get?"":"form"}));return sign.content}async function init(cfg){siteKey=cfg.skey,siteType=cfg.stype;cfg=await local.get(key,"device");if(0|《|》/g,"").replace(/\$|#/g," ").trim()}function jsonParse(input,json){try{let url=json.url??"";if(!(url=url.startsWith("//")?"https:"+url:url).startsWith("http"))return{};let headers=json.headers||{};var ua=(json["user-agent"]||"").trim(),referer=(0{headers[hk]||delete headers[hk]}),{header:headers,url:url}}catch(error){console.log(error)}return{}}function __jsEvalReturn(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search}}export{__jsEvalReturn};