v-fixed43: AI短剧菜单/直播点击暂停播放/授权公告弹窗/IPv6恢复/账号迁移/TVBOX lives修复
This commit is contained in:
1 parent
5d6351c9ef
commit
1a5f53350c
10 files changed
+110
-11
No files matched your search
@@ -2,6 +2,25 @@
|
||||
|
||||
格式参考本机发版惯例:按日期分条,`🐛修复` / `✨新功能`。
|
||||
|
||||
## v-fixed43 (2026-11-01)
|
||||
|
||||
### ✨ 新功能
|
||||
- 📺 电脑端顶部菜单新增「AI短剧」入口(移动端底部导航同步),点击跳转搜索 AI短剧
|
||||
- 📡 `/live` 直播页恢复:点击画面即可暂停/播放,暂停时显示大播放键
|
||||
- 📢 首页公告改为动态读取授权系统(CardAuth)推送内容,免责声明弹窗移除,仅保留授权公告弹窗
|
||||
|
||||
### 🐛 修复
|
||||
- 🔐 登录账号改为 `jinghui` / `a3396336`,播放记录从旧 `admin` 账号迁移至新账号(历史记录恢复)
|
||||
- 🌐 恢复 IPv6 自动跳转(tv6.88531.cn),移除首次访问选择页
|
||||
- 🚫 TVBOX 接口移除「4K」菜单,保留「AI短剧」
|
||||
- 🔗 直播页右上角「开源地址」改为自建 Gitea 仓库
|
||||
- 📡 TVBOX 配置 `lives` 直播源地址修正为 `?live=txt`(原死链 `/api/live/channels`)
|
||||
|
||||
### 📦 安装/升级
|
||||
- TVBox/影视仓用户无需任何操作,重新打开 App 自动拉到新版
|
||||
- 网页用户刷新即升级(无需清缓存)
|
||||
- 体验地址:https://tv.88531.cn
|
||||
|
||||
## v-fixed42 (2026-10-30)
|
||||
|
||||
### ✨ 新功能
|
||||
|
||||
@@ -12,11 +12,12 @@ if(tv)T.push({tid:"904",name:"电视剧",kind:"agg",native:String(tv.type_id),ch
|
||||
if(vy)T.push({tid:"905",name:"综艺",kind:"agg",native:String(vy.type_id),ch:kd(vy),area:""});
|
||||
if(to)T.push({tid:"906",name:"动画片",kind:"direct",native:String(to.type_id),ch:[],area:""});
|
||||
if(an)T.push({tid:"907",name:"动漫",kind:"agg",native:String(an.type_id),ch:kd(an),area:""});
|
||||
T.push({tid:"909",name:"AI短剧",kind:"search",native:"",wd:"AI短剧",kwPat:"AI|短剧|微短剧",ch:[],area:""});
|
||||
let Y=[{n:"全部",v:""}];for(let y=2026;y>=2010;y--)Y.push({n:String(y),v:String(y)});
|
||||
let AR=[{n:"全部",v:""},{n:"中国大陆",v:"中国大陆"},{n:"中国香港",v:"中国香港"},{n:"中国台湾",v:"中国台湾"},{n:"美国",v:"美国"},{n:"韩国",v:"韩国"},{n:"日本",v:"日本"},{n:"英国",v:"英国"},{n:"法国",v:"法国"},{n:"德国",v:"德国"},{n:"泰国",v:"泰国"},{n:"印度",v:"印度"},{n:"加拿大",v:"加拿大"},{n:"其他",v:"其他"}];
|
||||
let BY=[{n:"最新",v:"time"},{n:"最热",v:"hits"},{n:"评分",v:"score"}];
|
||||
let cls7=[],tops={},filters={};
|
||||
T.forEach(t=>{cls7.push({type_id:t.tid,type_name:t.name,type_pid:0});tops[t.tid]={kind:t.kind,native:t.native,ch:t.ch,area:t.area||""};let g=[];if(t.ch&&t.ch.length)g.push({key:"st",name:"分类",value:[{n:"全部",v:""}].concat(t.ch.map(c=>({n:String(c.type_name),v:String(c.type_name)}))) });if(t.tid!=="901")g.push({key:"area",name:"地区",value:AR});g.push({key:"year",name:"年份",value:Y});g.push({key:"by",name:"排序",value:BY});filters[t.tid]=g});
|
||||
T.forEach(t=>{cls7.push({type_id:t.tid,type_name:t.name,type_pid:0});tops[t.tid]={kind:t.kind,native:t.native,wd:t.wd||"",kwPat:t.kwPat||"",ch:t.ch,area:t.area||""};let g=[];if(t.ch&&t.ch.length)g.push({key:"st",name:"分类",value:[{n:"全部",v:""}].concat(t.ch.map(c=>({n:String(c.type_name),v:String(c.type_name)}))) });if(t.tid!=="901")g.push({key:"area",name:"地区",value:AR});g.push({key:"year",name:"年份",value:Y});g.push({key:"by",name:"排序",value:BY});filters[t.tid]=g});
|
||||
if(!cls7.length){(cls||[]).forEach(c=>cls7.push({type_id:String(c.type_id),type_name:c.type_name,type_pid:c.type_pid}))}
|
||||
return {class:cls7,tops:tops,filters:filters};
|
||||
}
|
||||
@@ -49,19 +50,20 @@ return out;
|
||||
async function P(e,sp){try{let url=new URL(e.url);console.log("[TVBOX-P]",url.search.slice(0,300));let sv=sp.get("site")||"",site=sv,emb="",qi=sv.indexOf("?");if(qi>=0){emb=sv.slice(qi+1);site=sv.slice(0,qi)}site=site.split("/")[0].split("?")[0].trim();let raw=url.search.slice(1),pp=[];raw.split("&").forEach(x=>{x&&x.indexOf("site=")!==0&&pp.push(x)});if(emb)pp=emb.split("&").concat(pp);let fw=pp.join("&");let cfg=(await(0,c.iE)()).SourceConfig||[];
|
||||
if(site==="all")return VJ(await ALL(fw,cfg));let sc=cfg.find(x=>(x.key||x.name)===site)||cfg.find(x=>x.name===site);if(!sc){console.log("[TVBOX-P] site not found:",site);return VJ(VB())}let base=String(sc.api||"").replace(/[?&]+$/,"");let cls=await CL(base);let doF=async q=>{try{let ctl=new AbortController,tm=setTimeout(()=>ctl.abort(),1e4),r=await fetch(base+(q?"?"+q:""),{headers:HD,signal:ctl.signal});if(clearTimeout(tm),!r.ok)return null;let tx=await r.text();try{let j=JSON.parse(tx);return j&&typeof j==="object"&&!Array.isArray(j)?j:null}catch(x){return null}}catch(x){return null}};async function AGG(tids,extra){extra=extra||"";let key=base+"|"+tids.join(",")+"|"+extra;let ent=_aggC.get(key);if(!ent||Date.now()-ent[0]>6e5){let pool=[],seen={};console.log("[TVBOX-AGG] base="+base+" tids="+tids.join(","));for(let i=0;i<tids.length;i++){let id=tids[i];let r=null; for(let a=0;a<2;a++){r=await doF("ac=videolist&pg=1&t="+id+extra);if(r&&Array.isArray(r.list)&&r.list.length)break;if(a===0)await new Promise(z=>setTimeout(z,700))} if(i===0)console.log("[TVBOX-AGG] child0="+id+" r="+(r?JSON.stringify({code:r.code,n:r.list?r.list.length:-1}):"null"));if(r&&Array.isArray(r.list))for(let it of r.list){let v=it.vod_id;if(v!=null&&!seen[v]){seen[v]=1;pool.push(it)}} if(i<tids.length-1)await new Promise(z=>setTimeout(z,250))}pool.sort((a,b)=>String(b.vod_time==null?"":b.vod_time).localeCompare(String(a.vod_time==null?"":a.vod_time)));console.log("[TVBOX-AGG] tids="+tids.length+" got="+pool.length);if(pool.length){ent=[Date.now(),pool];_aggC.set(key,ent)}else{ent=[Date.now(),[]]}}let p=ent[1];return {code:1,msg:"数据列表",page:1,pagecount:1,limit:p.length,total:p.length,list:p}}
|
||||
let mk=MK(cls);let _sp=new URLSearchParams(fw),_t=_sp.get("t")||"",_st=_sp.get("st")||"";
|
||||
let _area="",_aggTids=null,_forceAgg=false,_aggRan=false;let _top=mk.tops[_t];
|
||||
let _area="",_aggTids=null,_forceAgg=false,_aggRan=false,_kwPat=null;let _top=mk.tops[_t];
|
||||
let _stv=_st;
|
||||
if(_st&&!/^\d+$/.test(_st)){let _hit=(cls||[]).find(c=>c&&String(c.type_name).trim()===_st);if(_hit)_stv=String(_hit.type_id)}
|
||||
if(_top){if(_top.area)_area=_top.area;
|
||||
if(_st){_sp.set("t",_stv)}
|
||||
else if(_top.kind==="agg"){_aggTids=_top.ch.map(c=>String(c.type_id));_forceAgg=true}
|
||||
else if(_top.kind==="search"){_sp.set("wd",_top.wd);_sp.delete("t");_kwPat=_top.kwPat}
|
||||
else{_sp.set("t",_top.native)}}
|
||||
else if(_st){_sp.set("t",_stv)}
|
||||
_sp.delete("st");if(_area&&!_sp.get("area"))_sp.set("area",_area);
|
||||
let _extra="";["year","area","by"].forEach(k=>{let v=_sp.get(k);if(v)_extra+="&"+k+"="+encodeURIComponent(v)});
|
||||
fw=_sp.toString();let d;
|
||||
if(_aggTids&&_forceAgg){d=await AGG(_aggTids,_extra);_aggRan=true}
|
||||
else{d=await doF(fw);if(_aggTids&&(!d||!d.list||d.list.length<10)){d=await AGG(_aggTids,_extra);_aggRan=true}}if(!d){console.log("[TVBOX-P] upstream bad:",fw.slice(0,120));return VJ(VB(cls))}if(!Array.isArray(d.class)||!d.class.length)d.class=cls;if(!Array.isArray(d.list))d.list=[];let mt=_aggRan?null:fw.match(/(?:^|&)t=([^&]*)/);if(mt){let tid=decodeURIComponent(mt[1]||"");if(/^\d+$/.test(tid)){let hit=d.list.some(x=>String(x.type_id)===tid);if(!hit){let nm=(d.class||[]).find(x=>String(x.type_id)===tid);if(nm){let d2=await doF(fw.replace(/(^|&)t=[^&]*/,"$1t="+encodeURIComponent(nm.type_name)));if(d2&&Array.isArray(d2.list)&&d2.list.length){if(!Array.isArray(d2.class)||!d2.class.length)d2.class=d.class;d=d2}}}}}try{
|
||||
else{d=await doF(fw);if(_aggTids&&(!d||!d.list||d.list.length<10)){d=await AGG(_aggTids,_extra);_aggRan=true}}if(!d){console.log("[TVBOX-P] upstream bad:",fw.slice(0,120));return VJ(VB(cls))}if(!Array.isArray(d.class)||!d.class.length)d.class=cls;if(!Array.isArray(d.list))d.list=[];let mt=(_aggRan||_kwPat)?null:fw.match(/(?:^|&)t=([^&]*)/);if(mt){let tid=decodeURIComponent(mt[1]||"");if(/^\d+$/.test(tid)){let hit=d.list.some(x=>String(x.type_id)===tid);if(!hit){let nm=(d.class||[]).find(x=>String(x.type_id)===tid);if(nm){let d2=await doF(fw.replace(/(^|&)t=[^&]*/,"$1t="+encodeURIComponent(nm.type_name)));if(d2&&Array.isArray(d2.list)&&d2.list.length){if(!Array.isArray(d2.class)||!d2.class.length)d2.class=d.class;d=d2}}}}}try{
|
||||
let _q=new URLSearchParams(fw);
|
||||
let _yr=_q.get("year")||"",_ar=_q.get("area")||"",_by=_q.get("by")||"",_tid=_q.get("t")||"";
|
||||
if(_yr&&!d.list.length){let _f2=fw.split("&").filter(p=>p.indexOf("t=")!==0&&p.indexOf("year=")!==0).concat("year="+encodeURIComponent(_yr)).join("&");let _d2=await doF(_f2);if(_d2&&Array.isArray(_d2.list)){if(!Array.isArray(_d2.class)||!_d2.class.length)_d2.class=d.class;d=_d2}}
|
||||
@@ -69,7 +71,8 @@ if(!Array.isArray(d.list))d.list=[];
|
||||
if(_yr&&_tid&&/^\d+$/.test(_tid)){let _sub=d.list.filter(x=>String(x.type_id)===_tid);if(_sub.length)d.list=_sub}
|
||||
if(_yr){let _y2=d.list.filter(x=>String(x.vod_year==null?"":x.vod_year).indexOf(_yr)>=0);if(_y2.length)d.list=_y2}
|
||||
if(_ar){let _a2=d.list.filter(x=>String(x.vod_area==null?"":x.vod_area).indexOf(_ar)>=0);if(_a2.length)d.list=_a2}
|
||||
if(_kwPat){let _kr=new RegExp(_kwPat,"i");let _k2=d.list.filter(x=>_kr.test(String(x.vod_name==null?"":x.vod_name)));if(_k2.length)d.list=_k2;d.list.sort((a,b)=>String(b.vod_time==null?"":b.vod_time).localeCompare(String(a.vod_time==null?"":a.vod_time)))}
|
||||
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=["香港电影","香港剧","电影","电视剧","综艺","动画片","动漫"];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"},resolvedPagePath:"/app/src/Line 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")||"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
|
||||
@@ -25,6 +25,22 @@ echo "[4/5] 语法校验 ..."
|
||||
docker exec "$C" node --check /app/.next/server/app/api/tvbox/route.js
|
||||
docker exec "$C" node --check /app/.next/server/app/api/filter/route.js
|
||||
|
||||
echo "[4b/5] 应用公告补丁(免责声明→CardAuth公告)..."
|
||||
docker cp "$DIR/patch-announcement.js" "$C:/tmp/patch-announcement.js"
|
||||
docker exec "$C" node /tmp/patch-announcement.js || true
|
||||
docker exec "$C" node --check /app/.next/server/chunks/8583.js || { echo "8583.js 语法失败"; exit 1; }
|
||||
|
||||
echo "[4c/5] 移除重复的 HubNotice 弹窗..."
|
||||
docker cp "$DIR/patch-hubnotice-remove.js" "$C:/tmp/patch-hubnotice-remove.js"
|
||||
docker exec "$C" node /tmp/patch-hubnotice-remove.js || true
|
||||
|
||||
echo "[4d/5] 注入直播 /live 功能..."
|
||||
python3 "$DIR/inject_live.py" || echo "live inject failed (non-fatal)"
|
||||
|
||||
echo "[4e/5] 顶部/底部菜单加入 AI短剧 入口..."
|
||||
docker cp "$DIR/patch-aidrama-menu.js" "$C:/tmp/patch-aidrama-menu.js"
|
||||
docker exec "$C" node /tmp/patch-aidrama-menu.js || true
|
||||
|
||||
echo "[5/5] 重启 ..."
|
||||
docker restart "$C" >/dev/null
|
||||
sleep 5
|
||||
|
||||
@@ -1 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[923],{3747:function(e,t,a){Promise.resolve().then(a.bind(a,805))},805:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return v}});var l=a(4393),r=a(5538);let s=(0,a(4123).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var o=a(4908),n=a(6402),i=a(6501);let c=[{label:"全部",value:""},{label:"香港",value:"香港"},{label:"大陆",value:"大陆"},{label:"台湾",value:"台湾"},{label:"美国",value:"美国"},{label:"日本",value:"日本"},{label:"韩国",value:"韩国"},{label:"泰国",value:"泰国"},{label:"英国",value:"英国"},{label:"法国",value:"法国"}],u=[{label:"全部",value:""},{label:"电影",value:"电影"},{label:"电视剧",value:"电视剧"},{label:"连续剧",value:"连续剧"},{label:"综艺",value:"综艺"},{label:"动漫",value:"动漫"},{label:"动作片",value:"动作片"},{label:"喜剧片",value:"喜剧片"},{label:"爱情片",value:"爱情片"},{label:"科幻片",value:"科幻片"},{label:"恐怖片",value:"恐怖片"},{label:"剧情片",value:"剧情片"},{label:"战争片",value:"战争片"},{label:"国产剧",value:"国产剧"},{label:"香港剧",value:"香港剧"},{label:"台湾剧",value:"台湾剧"},{label:"欧美剧",value:"欧美剧"},{label:"韩国剧",value:"韩国剧"},{label:"日本剧",value:"日本剧"},{label:"泰国剧",value:"泰国剧"},{label:"海外剧",value:"海外剧"},{label:"大陆综艺",value:"大陆综艺"},{label:"港台综艺",value:"港台综艺"},{label:"日韩综艺",value:"日韩综艺"},{label:"欧美综艺",value:"欧美综艺"},{label:"国产动漫",value:"国产动漫"},{label:"日韩动漫",value:"日韩动漫"},{label:"欧美动漫",value:"欧美动漫"},{label:"港台动漫",value:"港台动漫"},{label:"记录片",value:"记录片"},{label:"短剧",value:"短剧"}],d=function(){let e=[{label:"全部",value:""}],t=new Date().getFullYear();for(let a=t;a>=t-15;a--)e.push({label:"".concat(a),value:"".concat(a)});return e}();function h(e){let{label:t,options:a,value:r,onChange:s}=e;return(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs sm:text-sm font-medium text-gray-600 dark:text-gray-400 min-w-[48px]",children:t}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>{let t=r===e.value;return(0,l.jsx)("button",{onClick:()=>s(e.value),className:"px-3 py-1.5 text-xs sm:text-sm font-medium rounded-full transition-all duration-200 whitespace-nowrap ".concat(t?"bg-purple-500 text-white shadow-sm":"bg-gray-200/60 text-gray-700 hover:bg-gray-300/60 dark:bg-gray-700/60 dark:text-gray-300 dark:hover:bg-gray-600/60"),children:e.label},e.value||"all")})})]})}function p(){let[e,t]=(0,o.useState)([]),[a,p]=(0,o.useState)("all"),[v,x]=(0,o.useState)([]),[g,m]=(0,o.useState)(""),[b,f]=(0,o.useState)(""),[y,w]=(0,o.useState)(""),[k,j]=(0,o.useState)([]),[N,C]=(0,o.useState)(!1),[S,_]=(0,o.useState)(!1),[P,R]=(0,o.useState)(1),[E,D]=(0,o.useState)(!0),[Z,I]=(0,o.useState)(""),L=(0,o.useRef)(null),q=(0,o.useRef)(null),z=(0,o.useRef)(0),H="all"===a;(0,o.useEffect)(()=>{(async()=>{try{var e;let a=await fetch("/api/filter?action=sources"),l=await a.json();(null===(e=l.sources)||void 0===e?void 0:e.length)&&(t(l.sources),p("all"))}catch(e){I("加载资源站列表失败")}})()},[]),(0,o.useEffect)(()=>{if(H){x([]),m("");return}a&&(async()=>{try{x([]),m("");let e=await fetch("/api/filter?action=classes&source=".concat(encodeURIComponent(a))),t=await e.json();Array.isArray(t.classes)&&x(t.classes)}catch(e){}})()},[a,H]);let M=(0,o.useCallback)(async(e,t)=>{if(!a)return;let l=++z.current;t?(C(!0),I("")):_(!0);try{let r=new URLSearchParams({action:"browse",source:a,pg:String(e)});H?g&&r.set("cat",g):g&&r.set("t",g),b&&r.set("area",b),y&&r.set("year",y);let s=await fetch("/api/filter?".concat(r.toString())),o=await s.json();if(l!==z.current)return;if(o.error){I(o.error);return}let n=Array.isArray(o.list)?o.list:[];j(e=>{let a=t?n:[...e,...n],s=new Set;return a.filter(x=>{let k=x.title+"|"+x.year;return!s.has(k)&&(s.add(k),!0)})}),R(o.next_pg||e+1),D(!!o.has_more&&n.length>0)}catch(e){l===z.current&&I("加载失败,请稍后重试")}finally{l===z.current&&(C(!1),_(!1))}},[a,g,b,y,H]);(0,o.useEffect)(()=>{if(!a)return;j([]),R(1),D(!0);let e=setTimeout(()=>M(1,!0),100);return()=>clearTimeout(e)},[a,g,b,y,M]),(0,o.useEffect)(()=>{if(!E||N||S||!L.current)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&E&&!N&&!S&&M(P,!1)},{threshold:.1});return e.observe(L.current),q.current=e,()=>{q.current&&q.current.disconnect()}},[E,N,S,P,M]);let U=H?u:[{label:"全部",value:""},...v.map(e=>({label:e.type_name,value:e.type_id}))],A=[{label:"全部资源站",value:"all"},...e.map(e=>({label:e.name,value:e.key}))],B=!N&&!S&&0===k.length&&!Z&&!!a;return(0,l.jsx)(n.Z,{activePath:"/filter",children:(0,l.jsxs)("div",{className:Line truncated
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[923],{3747:function(e,t,a){Promise.resolve().then(a.bind(a,805))},805:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return v}});var l=a(4393),r=a(5538);let s=(0,a(4123).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var o=a(4908),n=a(6402),i=a(6501);let c=[{label:"全部",value:""},{label:"香港",value:"香港"},{label:"大陆",value:"大陆"},{label:"台湾",value:"台湾"},{label:"美国",value:"美国"},{label:"日本",value:"日本"},{label:"韩国",value:"韩国"},{label:"泰国",value:"泰国"},{label:"英国",value:"英国"},{label:"法国",value:"法国"}],u=[{label:"全部",value:""},{label:"4K",value:"4K"},{label:"AI短剧",value:"AI短剧"},{label:"电影",value:"电影"},{label:"电视剧",value:"电视剧"},{label:"连续剧",value:"连续剧"},{label:"综艺",value:"综艺"},{label:"动漫",value:"动漫"},{label:"动作片",value:"动作片"},{label:"喜剧片",value:"喜剧片"},{label:"爱情片",value:"爱情片"},{label:"科幻片",value:"科幻片"},{label:"恐怖片",value:"恐怖片"},{label:"剧情片",value:"剧情片"},{label:"战争片",value:"战争片"},{label:"国产剧",value:"国产剧"},{label:"香港剧",value:"香港剧"},{label:"台湾剧",value:"台湾剧"},{label:"欧美剧",value:"欧美剧"},{label:"韩国剧",value:"韩国剧"},{label:"日本剧",value:"日本剧"},{label:"泰国剧",value:"泰国剧"},{label:"海外剧",value:"海外剧"},{label:"大陆综艺",value:"大陆综艺"},{label:"港台综艺",value:"港台综艺"},{label:"日韩综艺",value:"日韩综艺"},{label:"欧美综艺",value:"欧美综艺"},{label:"国产动漫",value:"国产动漫"},{label:"日韩动漫",value:"日韩动漫"},{label:"欧美动漫",value:"欧美动漫"},{label:"港台动漫",value:"港台动漫"},{label:"记录片",value:"记录片"},{label:"短剧",value:"短剧"}],d=function(){let e=[{label:"全部",value:""}],t=new Date().getFullYear();for(let a=t;a>=t-15;a--)e.push({label:"".concat(a),value:"".concat(a)});return e}();function h(e){let{label:t,options:a,value:r,onChange:s}=e;return(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs sm:text-sm font-medium text-gray-600 dark:text-gray-400 min-w-[48px]",children:t}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>{let t=r===e.value;return(0,l.jsx)("button",{onClick:()=>s(e.value),className:"px-3 py-1.5 text-xs sm:text-sm font-medium rounded-full transition-all duration-200 whitespace-nowrap ".concat(t?"bg-purple-500 text-white shadow-sm":"bg-gray-200/60 text-gray-700 hover:bg-gray-300/60 dark:bg-gray-700/60 dark:text-gray-300 dark:hover:bg-gray-600/60"),children:e.label},e.value||"all")})})]})}function p(){let[e,t]=(0,o.useState)([]),[a,p]=(0,o.useState)("all"),[v,x]=(0,o.useState)([]),[g,m]=(0,o.useState)(""),[b,f]=(0,o.useState)(""),[y,w]=(0,o.useState)(""),[k,j]=(0,o.useState)([]),[N,C]=(0,o.useState)(!1),[S,_]=(0,o.useState)(!1),[P,R]=(0,o.useState)(1),[E,D]=(0,o.useState)(!0),[Z,I]=(0,o.useState)(""),L=(0,o.useRef)(null),q=(0,o.useRef)(null),z=(0,o.useRef)(0),H="all"===a;(0,o.useEffect)(()=>{(async()=>{try{var e;let a=await fetch("/api/filter?action=sources"),l=await a.json();(null===(e=l.sources)||void 0===e?void 0:e.length)&&(t(l.sources),p("all"))}catch(e){I("加载资源站列表失败")}})()},[]),(0,o.useEffect)(()=>{if(H){x([]),m("");return}a&&(async()=>{try{x([]),m("");let e=await fetch("/api/filter?action=classes&source=".concat(encodeURIComponent(a))),t=await e.json();Array.isArray(t.classes)&&x(t.classes)}catch(e){}})()},[a,H]);let M=(0,o.useCallback)(async(e,t)=>{if(!a)return;let l=++z.current;t?(C(!0),I("")):_(!0);try{let r=new URLSearchParams({action:"browse",source:a,pg:String(e)});H?g&&r.set("cat",g):g&&r.set("t",g),b&&r.set("area",b),y&&r.set("year",y);let s=await fetch("/api/filter?".concat(r.toString())),o=await s.json();if(l!==z.current)return;if(o.error){I(o.error);return}let n=Array.isArray(o.list)?o.list:[];j(e=>{let a=t?n:[...e,...n],s=new Set;return a.filter(x=>{let k=x.title+"|"+x.year;return!s.has(k)&&(s.add(k),!0)})}),R(o.next_pg||e+1),D(!!o.has_more&&n.length>0)}catch(e){l===z.current&&I("加载失败,请稍后重试")}finally{l===z.current&&(C(!1),_(!1))}},[a,g,b,y,H]);(0,o.useEffect)(()=>{if(!a)return;j([]),R(1),D(!0);let e=setTimeout(()=>M(1,!0),100);return()=>clearTimeout(e)},[a,g,b,y,M]),(0,o.useEffect)(()=>{if(!E||N||S||!L.current)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&E&&!N&&!S&&M(P,!1)},{threshold:.1});return e.observe(L.current),q.current=e,()=>{q.current&&q.current.disconnect()}},[E,N,S,P,M]);let U=H?u:[{label:"全部",value:""},...v.map(e=>({label:e.type_name,value:e.type_id}))],A=[{label:"全部资源站",value:"all"},...e.map(e=>({label:e.name,value:e.key}))],B=!N&&!S&&0===k.length&&!Z&&!!a;return(0,l.jsx)(n.ZLine truncated
|
||||
@@ -11,10 +11,10 @@ HOOK_OLD = 'try{let _lv=new URL(e.url).searchParams.get("live");if(_lv)return aw
|
||||
HOOK = 'try{let _lurl=new URL(e.url),_lv=_lurl.searchParams.get("live");if(!_lv&&_lurl.pathname==="/live")_lv="page";if(_lv)return await LIVE(_lv,e)}catch(_le){console.log("[LIVE-HOOK]",_le&&_le.message)}'
|
||||
|
||||
def read(p):
|
||||
return subprocess.run(["docker","exec","katelyatv","cat",p],capture_output=True,check=True).stdout.decode()
|
||||
return subprocess.run(["docker","exec","-u","root","katelyatv","cat",p],capture_output=True,check=True).stdout.decode()
|
||||
|
||||
def write(p, data):
|
||||
r=subprocess.run(["docker","exec","-i","katelyatv","sh","-c",f"cat > {p}"],input=data.encode(),capture_output=True)
|
||||
r=subprocess.run(["docker","exec","-u","root","-i","katelyatv","sh","-c",f"cat > {p}"],input=data.encode(),capture_output=True)
|
||||
assert r.returncode==0, r.stderr.decode()[:300]
|
||||
|
||||
# ---- 1) route.js: 删旧块+插新块+入口钩子 ----
|
||||
@@ -60,9 +60,10 @@ if not any(x.get("source") == "/live" for x in af):
|
||||
# ---- 4) TVBOX lives 死链修复:指向直播文本源 ----
|
||||
OLD_LIVES = 'lives:[{name:"KatelyaTV直播",type:0,url:`${i}/api/live/channels`,epg:"",logo:""}]'
|
||||
NEW_LIVES = 'lives:[{name:"电视直播",type:0,url:`${i}/api/tvbox?live=txt`,ua:"Mozilla/5.0",epg:"",logo:""}]'
|
||||
if 'live=txt' not in src:
|
||||
if OLD_LIVES in src:
|
||||
assert src.count(OLD_LIVES) == 1, "lives anchor"
|
||||
src = src.replace(OLD_LIVES, NEW_LIVES, 1)
|
||||
# write + check
|
||||
with tempfile.NamedTemporaryFile('w', suffix='.js', delete=False) as f:
|
||||
f.write(src); tmp = f.name
|
||||
r = subprocess.run(['node', '--check', tmp], capture_output=True, text=True)
|
||||
@@ -70,5 +71,7 @@ if 'live=txt' not in src:
|
||||
assert r.returncode == 0, r.stderr[:600]
|
||||
write(P, src)
|
||||
print("config lives -> live=txt")
|
||||
else:
|
||||
print("lives already migrated or anchor missing")
|
||||
|
||||
print("DONE - restart container to apply")
|
||||
@@ -151,7 +151,7 @@ select{background:#171b24;color:#e5e7eb;border:1px solid #2a3140;border-radius:6
|
||||
.sec{font-size:13px;color:#6b7280;margin:2px 0 8px}
|
||||
.empty{color:#6b7280;font-size:13px;padding:20px 0;text-align:center}
|
||||
</style></head><body>
|
||||
<div class="hd"><a href="/" >‹</a><h1>电视直播 · 港澳台</h1><span style="flex:1"></span><a class="ghLink" href="https://github.com/katelya77/KatelyaTV" target="_blank" rel="noopener">⭐ 开源地址</a><button class="tvboxBtn" id="tvboxBtn">📺 TVBOX接入</button>
|
||||
<div class="hd"><a href="/" >‹</a><h1>电视直播 · 港澳台</h1><span style="flex:1"></span><a class="ghLink" href="https://gitea.88531.cn/jinghui/katelyatv" target="_blank" rel="noopener">⭐ 开源地址</a><button class="tvboxBtn" id="tvboxBtn">📺 TVBOX接入</button>
|
||||
<div class="tvboxPop" id="tvboxPop">
|
||||
<div class="tvboxPopTitle">TVBox / 影视仓 · 接入直播</div>
|
||||
<div class="tvboxRow"><span class="tvboxLbl">配置地址(含直播,推荐)</span><code id="tbCfg">—</code><button id="tbCfgCopy">复制</button></div>
|
||||
@@ -192,13 +192,15 @@ function playSrc(u,flv){
|
||||
v.onplaying=function(){stopTick();tip.style.display='none'};
|
||||
}
|
||||
bigplay.addEventListener('click',function(){v.muted=false;bigplay.style.display='none';v.play().catch(function(){})});
|
||||
v.addEventListener('click',function(){if(v.muted){v.muted=false;bigplay.style.display='none'}});
|
||||
v.addEventListener('click',function(){ if(v.muted){v.muted=false;bigplay.style.display='none'}; if(v.paused){ var pr=v.play(); if(pr&&pr.catch)pr.catch(function(){bigplay.style.display='flex'}) } else { v.pause() } });
|
||||
var btnPP=document.getElementById('btnPP'),btnMute=document.getElementById('btnMute');
|
||||
function syncCtrl(){
|
||||
btnPP.textContent=v.paused?'▶':'⏸';
|
||||
btnPP.title=v.paused?'播放':'暂停';
|
||||
btnMute.textContent=v.muted?'🔇':'🔊';
|
||||
btnMute.title=v.muted?'开启声音':'静音';
|
||||
bigplay.style.display=v.paused?'flex':'none';
|
||||
if(!v.paused) tip.style.display='none';
|
||||
}
|
||||
btnPP.addEventListener('click',function(e){e.stopPropagation();
|
||||
if(v.paused){var pr=v.play();if(pr&&pr.catch)pr.catch(function(){})}else{v.pause()}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// 顶部/底部菜单加入 AI短剧 入口(电脑端顶部菜单 + 移动端同步)
|
||||
const fs = require("fs");
|
||||
const dir = "/app/.next/static/chunks/";
|
||||
const files = fs.readdirSync(dir).filter(f => /^402-.*\.js$/.test(f));
|
||||
if (files.length !== 1) { console.log("expected 1 402 chunk, found", files); process.exit(0); }
|
||||
const t = dir + files[0];
|
||||
const MARK = "/*AI-DRAMA-MENU*/";
|
||||
let s = fs.readFileSync(t, "utf8");
|
||||
if (s.includes(MARK)) { console.log("ai-drama-menu: skip (already)"); process.exit(0); }
|
||||
const needle = '{icon:o.Z,label:"直播",href:"/live"}';
|
||||
const repl = needle + ',{icon:o.Z,label:"AI短剧",href:"/search?q=AI%E7%9F%AD%E5%89%A7"}' + MARK;
|
||||
const cnt = (s.match(new RegExp(needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g')) || []).length;
|
||||
if (cnt === 0) { console.error("needle not found"); process.exit(1); }
|
||||
s = s.split(needle).join(repl);
|
||||
fs.writeFileSync(t, s);
|
||||
console.log("ai-drama-menu: injected in", cnt, "locations");
|
||||
@@ -0,0 +1,20 @@
|
||||
// 把根布局的免责声明公告改为动态读取授权系统(CardAuth)公告
|
||||
// 幂等:含标记则跳过。失败开放(fail-open):授权系统异常时保留原公告。
|
||||
const fs = require("fs");
|
||||
const target = "/app/.next/server/chunks/8583.js";
|
||||
const MARK = "/*ANN-CARD*/";
|
||||
if (!fs.existsSync(target)) { console.log("8583.js not found"); process.exit(0); }
|
||||
let s = fs.readFileSync(target, "utf8");
|
||||
if (s.includes(MARK)) { console.log("layout-announcement: skip (already)"); process.exit(0); }
|
||||
const anchor = '}let u={STORAGE_TYPE:process.env.NEXT_PUBLIC_STORAGE_TYPE||"localstorage",ENABLE_REGISTER:n,IMAGE_PROXY:o,DOUBAN_PROXY:p};return';
|
||||
const idx = s.indexOf(anchor);
|
||||
if (idx < 0) { console.error("anchor not found"); process.exit(1); }
|
||||
const di = s.indexOf("async function d({children");
|
||||
if (di < 0 || idx < di) { console.error("anchor not inside layout d()"); process.exit(1); }
|
||||
const inject = ';' + MARK +
|
||||
'try{const __rc=await fetch("http://127.0.0.1:3000/api/license-config",{cache:"no-store",signal:AbortSignal.timeout(1500)}).then(x=>x.json());' +
|
||||
'if(__rc&&200===__rc.code&&__rc.data&&__rc.data.announcement&&__rc.data.announcement.content){s=String(__rc.data.announcement.content)}}catch(__e){}' +
|
||||
anchor;
|
||||
s = s.slice(0, idx) + inject + s.slice(idx + anchor.length);
|
||||
fs.writeFileSync(target, s);
|
||||
console.log("layout-announcement: injected");
|
||||
@@ -0,0 +1,18 @@
|
||||
// 移除 HubNotice 弹窗挂载,避免与原生公告弹窗重复
|
||||
const fs = require("fs");
|
||||
const target = "/app/.next/static/chunks/402-" + /* placeholder */ "3f8ac71d6e5b0924" + ".js";
|
||||
// find the chunk dynamically
|
||||
const dir = "/app/.next/static/chunks/";
|
||||
const fs2 = require("fs");
|
||||
const files = fs2.readdirSync(dir).filter(f => /^402-.*\.js$/.test(f));
|
||||
if (files.length !== 1) { console.log("expected 1 402 chunk, found", files); process.exit(0); }
|
||||
const t = dir + files[0];
|
||||
const MARK = "/*HUBNOTICE-REMOVED*/";
|
||||
let s = fs2.readFileSync(t, "utf8");
|
||||
if (s.includes(MARK)) { console.log("hubnotice-remove: skip (already)"); process.exit(0); }
|
||||
const needle = "(0,a.jsx)(HubNotice,{})";
|
||||
const idx = s.indexOf(needle);
|
||||
if (idx < 0) { console.error("HubNotice mount not found"); process.exit(1); }
|
||||
s = s.slice(0, idx) + MARK + s.slice(idx + needle.length);
|
||||
fs2.writeFileSync(t, s);
|
||||
console.log("hubnotice-remove: removed mount in", files[0]);
|
||||
@@ -208,7 +208,7 @@ function writeChecked(p, s) {
|
||||
log("tvbox: notice+warning v2 injected");
|
||||
})();
|
||||
|
||||
// ---------- 6) IPv6 智能跳转探针(客户端检测 IPv6 可达 → 直连 tv6.88531.cn 省服务器流量) ----------
|
||||
// ---------- 6) IPv6 智能跳转:首次访问弹选择页,已选则直跳上次选择的线路 ----------
|
||||
(function () {
|
||||
const dir = "/app/.next/static/chunks";
|
||||
let target = null;
|
||||
@@ -220,6 +220,8 @@ function writeChecked(p, s) {
|
||||
}
|
||||
if (!target) { failures.push("v6-probe: nav chunk not found"); return; }
|
||||
let s = FS.readFileSync(target, "utf8");
|
||||
// 清理旧版探针(V1 自动跳转 / V2 旧版)
|
||||
s = s.replace(/\/\*V6-PROBE-V[12]\*\/.*?catch\(e\)\{\}\s*/s, "");
|
||||
if (s.includes("/*V6-PROBE-V1*/")) { log("v6-probe: skip (already)"); return; }
|
||||
const probe = '/*V6-PROBE-V1*/try{if("tv.88531.cn"===location.hostname){var __v6k="__v6dest";var __v6t=+(localStorage.getItem(__v6k+"_t")||0);if(Date.now()-__v6t>21600000){localStorage.setItem(__v6k+"_t",Date.now());var __v6c=new AbortController();var __v6ti=setTimeout(function(){__v6c.abort()},1500);fetch("https://tv6.88531.cn/api/license-config",{mode:"no-cors",signal:__v6c.signal,cache:"no-store"}).then(function(){clearTimeout(__v6ti);location.replace("https://tv6.88531.cn"+location.pathname+location.search+location.hash)}).catch(function(){clearTimeout(__v6ti)})}}}catch(e){} ';
|
||||
writeChecked(target, probe + s);
|
||||
|
||||
Reference in new issue
Block a user