v-fixed43: TVBOX接口URL强制HTTPS(修复手机/电视端拉不到数据/频道为空)
This commit is contained in:
1 parent
3259ac5353
commit
3b5d23983a
1 file changed
+1
-1
@@ -75,4 +75,4 @@ if(_kwPat){let _kr=new RegExp(_kwPat,"i");let _k2=d.list.filter(x=>_kr.test(Stri
|
||||
if(_by&&d.list.length){let _gs=(x,k)=>String(x[k]==null?"":x[k]),_gn=x=>{let v=parseFloat(x);return isNaN(v)?0:v};d.list.sort((a,b)=>{if(_by==="time")return _gs(b,"vod_time").localeCompare(_gs(a,"vod_time"));if(_by==="hits")return(_gn(b.vod_hits)-_gn(a.vod_hits))||(_gn(b.vod_score)-_gn(a.vod_score))||_gs(b,"vod_time").localeCompare(_gs(a,"vod_time"));if(_by==="score")return _gn(b.vod_score)-_gn(a.vod_score);return 0})}
|
||||
}catch(_e){console.log("[TVBOX-FILTER] err",_e&&_e.message)}
|
||||
try{d.class=mk.class;d.filters=mk.filters;}catch(_fe){console.log("[TVBOX-FILTERS] err",_fe&&_fe.message)}
|
||||
return VJ(d)}catch(x){console.log("[TVBOX-P] ERR",x&&x.message);return VJ(VB())}}let l="nodejs";async function u(e){console.log("[TVBOX-REQ]",e.method,e.url);try{let{searchParams:o}=new URL(e.url),t=o.get("format")||"json",n=e.headers.get("host")||"localhost:3000",a=e.headers.get("x-forwarded-proto")||"http",i=`${a}://${n}`,r=((await (0,c.iE)()).SourceConfig||[]).filter(e=>!e.disabled);let DFLT=["电影","电视剧","连续剧","综艺","动漫","动画片","纪录片","记录片","短剧","短剧大全","动作片","喜剧片","爱情片","科幻片","恐怖片","剧情片","战争片","犯罪片","悬疑片","灾难片","奇幻片","冒险片","武侠片","枪战片","警匪片","动画电影","动漫电影","网络电影","国产剧","港台剧","港澳剧","香港剧","台湾剧","欧美剧","韩国剧","日本剧","泰国剧","海外剧","国产","港台","欧美","韩国","日本","泰国","海外","大陆综艺","港台综艺","日韩综艺","欧美综艺","海外综艺","国产动漫","日韩动漫","欧美动漫","港台动漫","海外动漫","日本动漫","里番动漫","AI漫剧","电影解说","预告片","体育","足球","篮球","体育赛事"];let cats={};let TOP7=["AI短剧","香港电影","香港剧","电影","电视剧","综艺","动画片","动漫"];r.forEach(function(e){cats[e.key||e.name]=TOP7;});if(0===r.length)return s.NextResponse.json({error:"没有配置任何视频源"},{status:500});let _pm=(new URL(e.url)).pathname.match(/^\/api\/tvbox\/([^\/]+)$/);if(_pm){console.log("[TVBOX-P] path-site:",_pm[1]);return await P(e,{get:k=>k==="site"?decodeURIComponent(_pm[1]):o.get(k)});}if(o.get("site"))return await P(e,o);if(o.get("ac")||o.get("t")||o.get("wd")||o.get("ids")||o.get("pg")){console.log("[TVBOX-P] vod-req without site:",(new URL(e.url)).search.slice(0,300));return VJ(VB())}console.log("[TVBOX-CFG] config requested:",(new URL(e.url)).search);let l={spider:"",wallpaper:`${i}/screenshot1.png`,sites:[{key:"all",name:"全部资源",type:1,api:`${i}/api/tvbox/all`,searchable:1,quickSearch:1,filterable:1,ext:"",timeout:60,categories:TOP7},...r.map(e=>{let o=1,t=e.api.toLowerCase();return(t.includes("at/xml")||t.endsWith(".xml"))&&(o=0),{key:e.key||e.name,name:e.name,type:o,api:`${i}/api/tvbox/${encodeURIComponent(e.key||e.name)}`,searchable:1,quickSearch:1,filterable:1,ext:e.detail||"",timeout:30,categories:cats[e.key||e.name]}})],parses:[{name:"Json并发",type:2,url:"Parallel"},{name:"Json轮询",type:2,url:"Sequence"},{name:"KatelyaTV内置解析",type:1,url:`${i}/api/parse?url=`,ext:{flag:["qiyi","qq","letv","sohu","youku","mgtv","bilibili","wasu","xigua","1905"]}}],flags:["youku","qq","iqiyi","qiyi","letv","sohu","tudou","pptv","mgtv","wasu","bilibili","le","duoduozy","renrenmi","xigua","优酷","腾讯","爱奇艺","奇艺","乐视","搜狐","土豆","PPTV","芒果","华数","哔哩","1905"],lives:[{name:"KatelyaTV直播",type:0,url:`${i}/api/live/channels`,epg:"",logo:""}],ads:["mimg.0c1q0l.cn","www.googletagmanager.com","www.google-analytics.com","mc.usihnbcq.cn","mg.g1mm3d.cn","mscs.svaeuzh.cn","cnzz.hhurm.com","tp.vinuxhome.com","cnzz.mmstat.com","www.baihuillq.com","s23.cnzz.com","z3.cnzz.com","c.cnzz.com","stj.v1vo.top","z12.cnzz.com","img.mosflower.cn","tips.gamevvip.com","ehwe.yhdtns.com","xdn.cqqc3.com","www.jixunkyy.cn","sp.chemacid.cn","hm.baidu.com","s9.cnzz.com","z6.cnzz.com","um.cavuc.com","mav.mavuz.com","wofwk.aoidf3.com","z5.cnzz.com","xc.hubeijieshikj.cn","tj.tianwenhu.com","xg.gars57.cn","k.jinxiuzhilv.com","cdn.bootcss.com","ppl.xunzhuo123.com","xomk.jiangjunmh.top","img.xunzhuo123.com","z1.cnzz.com","s13.cnzz.com","xg.huataisangao.cn","z7.cnzz.com","xg.huataisangao.cn","z2.cnzz.com","s96.cnzz.com","q11.cnzz.com","thy.dacedsfa.cn","xg.whsbpw.cn","s19.cnzz.com","z8.cnzz.com","s4.cnzz.com","f5w.as12df.top","ae01.alicdn.com","www.92424.cn","k.wudejia.com","vivovip.mmszxc.top","qiu.xixiqiu.com","cdnjs.hnfenxun.com","cms.qdwght.com"]};if("txt"!==t)return s.NextResponse.json(l,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET","Access-Control-Allow-Headers":"Content-Type","Cache-Control":"no-store"}});{let e=JSON.stringify(l,null,2),o=Buffer.from(e).toString("base64");return new s.NextResponse(o,{headers:{"Content-Type":"text/plain; charset=utf-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET","Access-Control-Allow-Headers":"Content-Type","Cache-Control":"no-store"}})}}catch(e){return s.NextResponse.json({error:"TVBox配置生成失败",details:e instanceof Error?e.message:String(e)},{status:500})}}async function p(){console.log("[TVBOX-OPT]");return new s.NextResponse(null,{status:200,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let m="standalone",f=new a.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/tvbox/route",pathname:"/api/tvbox",filename:"route",bundlePath:"app/api/tvbox/route"},resolvedPagePathLine truncated
|
||||
return VJ(d)}catch(x){console.log("[TVBOX-P] ERR",x&&x.message);return VJ(VB())}}let l="nodejs";async function u(e){console.log("[TVBOX-REQ]",e.method,e.url);try{let{searchParams:o}=new URL(e.url),t=o.get("format")||"json",n=e.headers.get("host")||"localhost:3000",a=e.headers.get("x-forwarded-proto")|| (n.indexOf("88531")>=0?"https":(/^(localhost|127\.|0\.0\.0\.0)/.test(n)?"http":"https")),i=`${a}://${n}`,r=((await (0,c.iE)()).SourceConfig||[]).filter(e=>!e.disabled);let DFLT=["电影","电视剧","连续剧","综艺","动漫","动画片","纪录片","记录片","短剧","短剧大全","动作片","喜剧片","爱情片","科幻片","恐怖片","剧情片","战争片","犯罪片","悬疑片","灾难片","奇幻片","冒险片","武侠片","枪战片","警匪片","动画电影","动漫电影","网络电影","国产剧","港台剧","港澳剧","香港剧","台湾剧","欧美剧","韩国剧","日本剧","泰国剧","海外剧","国产","港台","欧美","韩国","日本","泰国","海外","大陆综艺","港台综艺","日韩综艺","欧美综艺","海外综艺","国产动漫","日韩动漫","欧美动漫","港台动漫","海外动漫","日本动漫","里番动漫","AI漫剧","电影解说","预告片","体育","足球","篮球","体育赛事"];let cats={};let TOP7=["AI短剧","香港电影","香港剧","电影","电视剧","综艺","动画片","动漫"];r.forEach(function(e){cats[e.key||e.name]=TOP7;});if(0===r.length)return s.NextResponse.json({error:"没有配置任何视频源"},{status:500});let _pm=(new URL(e.url)).pathname.match(/^\/api\/tvbox\/([^\/]+)$/);if(_pm){console.log("[TVBOX-P] path-site:",_pm[1]);return await P(e,{get:k=>k==="site"?decodeURIComponent(_pm[1]):o.get(k)});}if(o.get("site"))return await P(e,o);if(o.get("ac")||o.get("t")||o.get("wd")||o.get("ids")||o.get("pg")){console.log("[TVBOX-P] vod-req without site:",(new URL(e.url)).search.slice(0,300));return VJ(VB())}console.log("[TVBOX-CFG] config requested:",(new URL(e.url)).search);let l={spider:"",wallpaper:`https://${n}/screenshot1.png`,sites:[{key:"all",name:"全部资源",type:1,api:`https://${n}/api/tvbox/all`,searchable:1,quickSearch:1,filterable:1,ext:"",timeout:60,categories:TOP7},...r.map(e=>{let o=1,t=e.api.toLowerCase();return(t.includes("at/xml")||t.endsWith(".xml"))&&(o=0),{key:e.key||e.name,name:e.name,type:o,api:`https://${n}/api/tvbox/${encodeURIComponent(e.key||e.name)}`,searchable:1,quickSearch:1,filterable:1,ext:e.detail||"",timeout:30,categories:cats[e.key||e.name]}})],parses:[{name:"Json并发",type:2,url:"Parallel"},{name:"Json轮询",type:2,url:"Sequence"},{name:"KatelyaTV内置解析",type:1,url:`https://${n}/api/parse?url=`,ext:{flag:["qiyi","qq","letv","sohu","youku","mgtv","bilibili","wasu","xigua","1905"]}}],flags:["youku","qq","iqiyi","qiyi","letv","sohu","tudou","pptv","mgtv","wasu","bilibili","le","duoduozy","renrenmi","xigua","优酷","腾讯","爱奇艺","奇艺","乐视","搜狐","土豆","PPTV","芒果","华数","哔哩","1905"],lives:[{name:"KatelyaTV直播",type:0,url:`https://${n}/api/live/channels`,epg:"",logo:""}],ads:["mimg.0c1q0l.cn","www.googletagmanager.com","www.google-analytics.com","mc.usihnbcq.cn","mg.g1mm3d.cn","mscs.svaeuzh.cn","cnzz.hhurm.com","tp.vinuxhome.com","cnzz.mmstat.com","www.baihuillq.com","s23.cnzz.com","z3.cnzz.com","c.cnzz.com","stj.v1vo.top","z12.cnzz.com","img.mosflower.cn","tips.gamevvip.com","ehwe.yhdtns.com","xdn.cqqc3.com","www.jixunkyy.cn","sp.chemacid.cn","hm.baidu.com","s9.cnzz.com","z6.cnzz.com","um.cavuc.com","mav.mavuz.com","wofwk.aoidf3.com","z5.cnzz.com","xc.hubeijieshikj.cn","tj.tianwenhu.com","xg.gars57.cn","k.jinxiuzhilv.com","cdn.bootcss.com","ppl.xunzhuo123.com","xomk.jiangjunmh.top","img.xunzhuo123.com","z1.cnzz.com","s13.cnzz.com","xg.huataisangao.cn","z7.cnzz.com","xg.huataisangao.cn","z2.cnzz.com","s96.cnzz.com","q11.cnzz.com","thy.dacedsfa.cn","xg.whsbpw.cn","s19.cnzz.com","z8.cnzz.com","s4.cnzz.com","f5w.as12df.top","ae01.alicdn.com","www.92424.cn","k.wudejia.com","vivovip.mmszxc.top","qiu.xixiqiu.com","cdnjs.hnfenxun.com","cms.qdwght.com"]};if("txt"!==t)return s.NextResponse.json(l,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET","Access-Control-Allow-Headers":"Content-Type","Cache-Control":"no-store"}});{let e=JSON.stringify(l,null,2),o=Buffer.from(e).toString("base64");return new s.NextResponse(o,{headers:{"Content-Type":"text/plain; charset=utf-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET","Access-Control-Allow-Headers":"Content-Type","Cache-Control":"no-store"}})}}catch(e){return s.NextResponse.json({error:"TVBox配置生成失败",details:e instanceof Error?e.message:String(e)},{status:500})}}async function p(){console.log("[TVBOX-OPT]");return new s.NextResponse(null,{status:200,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let m="standalone",f=new a.AppRouteRouteModule({definition:{kind:i.x.Line truncated
|
||||
Reference in new issue
Block a user