From 3b5d23983a91d03db57eaeb8e902c636b162a9f1 Mon Sep 17 00:00:00 2001 From: jinghui Date: Sun, 1 Nov 2026 12:58:08 +0800 Subject: [PATCH] =?UTF-8?q?v-fixed43:=20TVBOX=E6=8E=A5=E5=8F=A3URL?= =?UTF-8?q?=E5=BC=BA=E5=88=B6HTTPS=EF=BC=88=E4=BF=AE=E5=A4=8D=E6=89=8B?= =?UTF-8?q?=E6=9C=BA/=E7=94=B5=E8=A7=86=E7=AB=AF=E6=8B=89=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=95=B0=E6=8D=AE/=E9=A2=91=E9=81=93=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches/app-api-tvbox-route.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/app-api-tvbox-route.js b/patches/app-api-tvbox-route.js index ffc66a4..ee9854e 100644 --- a/patches/app-api-tvbox-route.js +++ b/patches/app-api-tvbox-route.js @@ -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"},resolvedPagePath:"/app/src/app/api/tvbox/route.ts",nextConfigOutput:m,userland:n}),{requestAsyncStorage:g,staticGenerationAsyncStorage:d,serverHooks:h}=f,C="/api/tvbox/route";function y(){return(0,r.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:d})}},13303:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{let fileConfig,cachedConfig;__webpack_require__.d(__webpack_exports__,{Hz:()=>API_CONFIG,Ih:()=>resetConfig,iE:()=>getConfig,jT:()=>getCacheTime,ll:()=>getAvailableApiSites});var _db__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(46257),_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(80540);let API_CONFIG={search:{path:"?ac=videolist&wd=",pagePath:"?ac=videolist&wd={query}&pg={page}",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",Accept:"application/json"}},detail:{path:"?ac=videolist&ids=",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",Accept:"application/json"}}};async function initConfig(){if(cachedConfig)return;if("true"===process.env.DOCKER_ENV){let _require=eval("require"),fs=_require("fs"),path=_require("path"),configPath=path.join(process.cwd(),"config.json"),raw=fs.readFileSync(configPath,"utf-8");fileConfig=JSON.parse(raw),console.log("load dynamic config success")}else fileConfig=_runtime__WEBPACK_IMPORTED_MODULE_1__.Z;let storageType=process.env.NEXT_PUBLIC_STORAGE_TYPE||"localstorage";if("localstorage"!==storageType){let storage=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)();try{let adminConfig=null;storage&&"function"==typeof storage.getAdminConfig&&(adminConfig=await storage.getAdminConfig());let userNames=[];if(storage&&"function"==typeof storage.getAllUsers)try{userNames=await storage.getAllUsers()}catch(e){console.error("获取用户列表失败:",e)}let apiSiteEntries=Object.entries(fileConfig.api_site);if(adminConfig){let existed=new Set((adminConfig.SourceConfig||[]).map(e=>e.key));apiSiteEntries.forEach(([e,o])=>{existed.has(e)||adminConfig.SourceConfig.push({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1,is_adult:o.is_adult||!1})});let apiSiteKeys=new Set(apiSiteEntries.map(([e])=>e));adminConfig.SourceConfig.forEach(e=>{if(apiSiteKeys.has(e.key)){let o=fileConfig.api_site[e.key];o&&(e.is_adult=o.is_adult||!1)}else e.from="custom"});let existedUsers=new Set((adminConfig.UserConfig.Users||[]).map(e=>e.username));userNames.forEach(e=>{existedUsers.has(e)||adminConfig.UserConfig.Users.push({username:e,role:"user"})});let ownerUser=process.env.USERNAME;ownerUser&&(adminConfig.UserConfig.Users=adminConfig.UserConfig.Users.filter(e=>e.username!==ownerUser),adminConfig.UserConfig.Users.unshift({username:ownerUser,role:"owner"}))}else{let allUsers=userNames.map(e=>({username:e,role:"user"})),ownerUser=process.env.USERNAME;ownerUser&&(allUsers=allUsers.filter(e=>e.username!==ownerUser)).unshift({username:ownerUser,role:"owner"}),adminConfig={SiteConfig:{SiteName:process.env.SITE_NAME||"KatelyaTV",Announcement:process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",SearchDownstreamMaxPage:Number(process.env.NEXT_PUBLIC_SEARCH_MAX_PAGE)||5,SiteInterfaceCacheTime:fileConfig.cache_time||7200,ImageProxy:process.env.NEXT_PUBLIC_IMAGE_PROXY||"",DoubanProxy:process.env.NEXT_PUBLIC_DOUBAN_PROXY||""},UserConfig:{AllowRegister:"true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,Users:allUsers},SourceConfig:apiSiteEntries.map(([e,o])=>({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1,is_adult:o.is_adult||!1}))}}storage&&"function"==typeof storage.setAdminConfig&&await storage.setAdminConfig(adminConfig),cachedConfig=adminConfig}catch(err){console.error("加载管理员配置失败:",err)}}else cachedConfig={SiteConfig:{SiteName:process.env.SITE_NAME||"KatelyaTV",Announcement:process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",SearchDownstreamMaxPage:Number(process.env.NEXT_PUBLIC_SEARCH_MAX_PAGE)||5,SiteInterfaceCacheTime:fileConfig.cache_time||7200,ImageProxy:process.env.NEXT_PUBLIC_IMAGE_PROXY||"",DoubanProxy:process.env.NEXT_PUBLIC_DOUBAN_PROXY||""},UserConfig:{AllowRegister:"true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,Users:[]},SourceConfig:Object.entries(fileConfig.api_site).map(([e,o])=>({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1}))}}async function getConfig(){let e=process.env.NEXT_PUBLIC_STORAGE_TYPE||"localstorage";if("true"===process.env.DOCKER_ENV||"localstorage"===e)return await initConfig(),cachedConfig;try{let e=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)(),o=null;if(e&&"function"==typeof e.getAdminConfig&&(o=await e.getAdminConfig()),o){o.SiteConfig.SiteName=process.env.SITE_NAME||"KatelyaTV",o.SiteConfig.Announcement=process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",o.UserConfig.AllowRegister="true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,o.SiteConfig.ImageProxy=process.env.NEXT_PUBLIC_IMAGE_PROXY||"",o.SiteConfig.DoubanProxy=process.env.NEXT_PUBLIC_DOUBAN_PROXY||"",fileConfig=_runtime__WEBPACK_IMPORTED_MODULE_1__.Z;let e=Object.entries(fileConfig.api_site),t=new Set((o.SourceConfig||[]).map(e=>e.key));e.forEach(([e,n])=>{t.has(e)||o.SourceConfig.push({key:e,name:n.name,api:n.api,detail:n.detail,from:"config",disabled:!1,is_adult:n.is_adult||!1})});let n=new Set(e.map(([e])=>e));o.SourceConfig.forEach(e=>{if(n.has(e.key)){let o=fileConfig.api_site[e.key];o&&(e.is_adult=o.is_adult||!1)}else e.from="custom"});let a=process.env.USERNAME||"",i=!1;o.UserConfig.Users.forEach(e=>{e.username!==a&&"owner"===e.role&&(e.role="user"),e.username===a&&(i=!0,e.role="owner")}),i||o.UserConfig.Users.unshift({username:a,role:"owner"}),cachedConfig=o}else await initConfig();return cachedConfig}catch(e){return await initConfig(),cachedConfig}}async function resetConfig(){let storage=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)(),userNames=[];if(storage&&"function"==typeof storage.getAllUsers)try{userNames=await storage.getAllUsers()}catch(e){console.error("获取用户列表失败:",e)}if("true"===process.env.DOCKER_ENV){let _require=eval("require"),fs=_require("fs"),path=_require("path"),configPath=path.join(process.cwd(),"config.json"),raw=fs.readFileSync(configPath,"utf-8");fileConfig=JSON.parse(raw),console.log("load dynamic config success")}else fileConfig=_runtime__WEBPACK_IMPORTED_MODULE_1__.Z;let apiSiteEntries=Object.entries(fileConfig.api_site),allUsers=userNames.map(e=>({username:e,role:"user"})),ownerUser=process.env.USERNAME;ownerUser&&(allUsers=allUsers.filter(e=>e.username!==ownerUser)).unshift({username:ownerUser,role:"owner"});let adminConfig={SiteConfig:{SiteName:process.env.SITE_NAME||"KatelyaTV",Announcement:process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",SearchDownstreamMaxPage:Number(process.env.NEXT_PUBLIC_SEARCH_MAX_PAGE)||5,SiteInterfaceCacheTime:fileConfig.cache_time||7200,ImageProxy:process.env.NEXT_PUBLIC_IMAGE_PROXY||"",DoubanProxy:process.env.NEXT_PUBLIC_DOUBAN_PROXY||""},UserConfig:{AllowRegister:"true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,Users:allUsers},SourceConfig:apiSiteEntries.map(([e,o])=>({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1}))};storage&&"function"==typeof storage.setAdminConfig&&await storage.setAdminConfig(adminConfig),null==cachedConfig&&(cachedConfig=adminConfig),cachedConfig.SiteConfig=adminConfig.SiteConfig,cachedConfig.UserConfig=adminConfig.UserConfig,cachedConfig.SourceConfig=adminConfig.SourceConfig}async function getCacheTime(){return(await getConfig()).SiteConfig.SiteInterfaceCacheTime||7200}async function getAvailableApiSites(e=!1){let o=await getConfig();if(!o.SourceConfig||!Array.isArray(o.SourceConfig))return console.warn("SourceConfig is missing or not an array, returning empty array"),[];let t=o.SourceConfig.filter(e=>!e.disabled).map(e=>({...e,is_adult:!0===e.is_adult}));return e&&(t=t.filter(e=>!e.is_adult)),t.map(e=>({key:e.key,name:e.name,api:e.api,detail:e.detail}))}async function getFilteredApiSites(e){let o=await getConfig();if(!o.SourceConfig||!Array.isArray(o.SourceConfig))return console.warn("SourceConfig is missing or not an array, returning empty array"),[];let t=!0;if(e)try{let o=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)(),n=await o.getUserSettings(e);t=n?.filter_adult_content!==!1}catch(e){console.warn("Failed to get user settings, using default filter:",e)}let n=o.SourceConfig.filter(e=>!e.disabled).map(e=>({...e,is_adult:!0===e.is_adult}));return t&&(n=n.filter(e=>!e.is_adult)),n.map(e=>({key:e.key,name:e.name,api:e.api,detail:e.detail}))}async function getAdultApiSites(){let e=await getConfig();return e.SourceConfig&&Array.isArray(e.SourceConfig)?e.SourceConfig.filter(e=>!e.disabled&&!0===e.is_adult).map(e=>({key:e.key,name:e.name,api:e.api,detail:e.detail})):(console.warn("SourceConfig is missing or not an array, returning empty array"),[])}},80540:(e,o,t)=>{t.d(o,{Z:()=>n});let n={cache_time:7200,api_site:{hnzy:{api:"https://hnzyapi.com/api.php/provide/vod",name:"火鸟资源",is_adult:!1},lzzy:{api:"https://api.liangzizy.com/inc/apijson_vod.php",name:"量子资源",is_adult:!1},ffzy:{api:"https://ffzyapi.com/api.php/provide/vod",name:"非凡资源",is_adult:!1},ykzy:{api:"https://api.yongjiuzy.cc/provide/vod",name:"永久资源",is_adult:!1},bdzy:{api:"https://api.1080zyku.com/inc/apijson_vod.php",name:"百度资源",is_adult:!1}}}}};var __webpack_require__=require("../../../webpack-runtime.js");__webpack_require__.C(exports);var __webpack_exec__=e=>__webpack_require__(__webpack_require__.s=e),__webpack_exports__=__webpack_require__.X(0,[7796,9864,3001,6257],()=>__webpack_exec__(36282));module.exports=__webpack_exports__})(); \ No newline at end of file +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.APP_ROUTE,page:"/api/tvbox/route",pathname:"/api/tvbox",filename:"route",bundlePath:"app/api/tvbox/route"},resolvedPagePath:"/app/src/app/api/tvbox/route.ts",nextConfigOutput:m,userland:n}),{requestAsyncStorage:g,staticGenerationAsyncStorage:d,serverHooks:h}=f,C="/api/tvbox/route";function y(){return(0,r.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:d})}},13303:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{let fileConfig,cachedConfig;__webpack_require__.d(__webpack_exports__,{Hz:()=>API_CONFIG,Ih:()=>resetConfig,iE:()=>getConfig,jT:()=>getCacheTime,ll:()=>getAvailableApiSites});var _db__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(46257),_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(80540);let API_CONFIG={search:{path:"?ac=videolist&wd=",pagePath:"?ac=videolist&wd={query}&pg={page}",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",Accept:"application/json"}},detail:{path:"?ac=videolist&ids=",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",Accept:"application/json"}}};async function initConfig(){if(cachedConfig)return;if("true"===process.env.DOCKER_ENV){let _require=eval("require"),fs=_require("fs"),path=_require("path"),configPath=path.join(process.cwd(),"config.json"),raw=fs.readFileSync(configPath,"utf-8");fileConfig=JSON.parse(raw),console.log("load dynamic config success")}else fileConfig=_runtime__WEBPACK_IMPORTED_MODULE_1__.Z;let storageType=process.env.NEXT_PUBLIC_STORAGE_TYPE||"localstorage";if("localstorage"!==storageType){let storage=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)();try{let adminConfig=null;storage&&"function"==typeof storage.getAdminConfig&&(adminConfig=await storage.getAdminConfig());let userNames=[];if(storage&&"function"==typeof storage.getAllUsers)try{userNames=await storage.getAllUsers()}catch(e){console.error("获取用户列表失败:",e)}let apiSiteEntries=Object.entries(fileConfig.api_site);if(adminConfig){let existed=new Set((adminConfig.SourceConfig||[]).map(e=>e.key));apiSiteEntries.forEach(([e,o])=>{existed.has(e)||adminConfig.SourceConfig.push({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1,is_adult:o.is_adult||!1})});let apiSiteKeys=new Set(apiSiteEntries.map(([e])=>e));adminConfig.SourceConfig.forEach(e=>{if(apiSiteKeys.has(e.key)){let o=fileConfig.api_site[e.key];o&&(e.is_adult=o.is_adult||!1)}else e.from="custom"});let existedUsers=new Set((adminConfig.UserConfig.Users||[]).map(e=>e.username));userNames.forEach(e=>{existedUsers.has(e)||adminConfig.UserConfig.Users.push({username:e,role:"user"})});let ownerUser=process.env.USERNAME;ownerUser&&(adminConfig.UserConfig.Users=adminConfig.UserConfig.Users.filter(e=>e.username!==ownerUser),adminConfig.UserConfig.Users.unshift({username:ownerUser,role:"owner"}))}else{let allUsers=userNames.map(e=>({username:e,role:"user"})),ownerUser=process.env.USERNAME;ownerUser&&(allUsers=allUsers.filter(e=>e.username!==ownerUser)).unshift({username:ownerUser,role:"owner"}),adminConfig={SiteConfig:{SiteName:process.env.SITE_NAME||"KatelyaTV",Announcement:process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",SearchDownstreamMaxPage:Number(process.env.NEXT_PUBLIC_SEARCH_MAX_PAGE)||5,SiteInterfaceCacheTime:fileConfig.cache_time||7200,ImageProxy:process.env.NEXT_PUBLIC_IMAGE_PROXY||"",DoubanProxy:process.env.NEXT_PUBLIC_DOUBAN_PROXY||""},UserConfig:{AllowRegister:"true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,Users:allUsers},SourceConfig:apiSiteEntries.map(([e,o])=>({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1,is_adult:o.is_adult||!1}))}}storage&&"function"==typeof storage.setAdminConfig&&await storage.setAdminConfig(adminConfig),cachedConfig=adminConfig}catch(err){console.error("加载管理员配置失败:",err)}}else cachedConfig={SiteConfig:{SiteName:process.env.SITE_NAME||"KatelyaTV",Announcement:process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",SearchDownstreamMaxPage:Number(process.env.NEXT_PUBLIC_SEARCH_MAX_PAGE)||5,SiteInterfaceCacheTime:fileConfig.cache_time||7200,ImageProxy:process.env.NEXT_PUBLIC_IMAGE_PROXY||"",DoubanProxy:process.env.NEXT_PUBLIC_DOUBAN_PROXY||""},UserConfig:{AllowRegister:"true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,Users:[]},SourceConfig:Object.entries(fileConfig.api_site).map(([e,o])=>({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1}))}}async function getConfig(){let e=process.env.NEXT_PUBLIC_STORAGE_TYPE||"localstorage";if("true"===process.env.DOCKER_ENV||"localstorage"===e)return await initConfig(),cachedConfig;try{let e=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)(),o=null;if(e&&"function"==typeof e.getAdminConfig&&(o=await e.getAdminConfig()),o){o.SiteConfig.SiteName=process.env.SITE_NAME||"KatelyaTV",o.SiteConfig.Announcement=process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",o.UserConfig.AllowRegister="true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,o.SiteConfig.ImageProxy=process.env.NEXT_PUBLIC_IMAGE_PROXY||"",o.SiteConfig.DoubanProxy=process.env.NEXT_PUBLIC_DOUBAN_PROXY||"",fileConfig=_runtime__WEBPACK_IMPORTED_MODULE_1__.Z;let e=Object.entries(fileConfig.api_site),t=new Set((o.SourceConfig||[]).map(e=>e.key));e.forEach(([e,n])=>{t.has(e)||o.SourceConfig.push({key:e,name:n.name,api:n.api,detail:n.detail,from:"config",disabled:!1,is_adult:n.is_adult||!1})});let n=new Set(e.map(([e])=>e));o.SourceConfig.forEach(e=>{if(n.has(e.key)){let o=fileConfig.api_site[e.key];o&&(e.is_adult=o.is_adult||!1)}else e.from="custom"});let a=process.env.USERNAME||"",i=!1;o.UserConfig.Users.forEach(e=>{e.username!==a&&"owner"===e.role&&(e.role="user"),e.username===a&&(i=!0,e.role="owner")}),i||o.UserConfig.Users.unshift({username:a,role:"owner"}),cachedConfig=o}else await initConfig();return cachedConfig}catch(e){return await initConfig(),cachedConfig}}async function resetConfig(){let storage=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)(),userNames=[];if(storage&&"function"==typeof storage.getAllUsers)try{userNames=await storage.getAllUsers()}catch(e){console.error("获取用户列表失败:",e)}if("true"===process.env.DOCKER_ENV){let _require=eval("require"),fs=_require("fs"),path=_require("path"),configPath=path.join(process.cwd(),"config.json"),raw=fs.readFileSync(configPath,"utf-8");fileConfig=JSON.parse(raw),console.log("load dynamic config success")}else fileConfig=_runtime__WEBPACK_IMPORTED_MODULE_1__.Z;let apiSiteEntries=Object.entries(fileConfig.api_site),allUsers=userNames.map(e=>({username:e,role:"user"})),ownerUser=process.env.USERNAME;ownerUser&&(allUsers=allUsers.filter(e=>e.username!==ownerUser)).unshift({username:ownerUser,role:"owner"});let adminConfig={SiteConfig:{SiteName:process.env.SITE_NAME||"KatelyaTV",Announcement:process.env.ANNOUNCEMENT||"本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。",SearchDownstreamMaxPage:Number(process.env.NEXT_PUBLIC_SEARCH_MAX_PAGE)||5,SiteInterfaceCacheTime:fileConfig.cache_time||7200,ImageProxy:process.env.NEXT_PUBLIC_IMAGE_PROXY||"",DoubanProxy:process.env.NEXT_PUBLIC_DOUBAN_PROXY||""},UserConfig:{AllowRegister:"true"===process.env.NEXT_PUBLIC_ENABLE_REGISTER,Users:allUsers},SourceConfig:apiSiteEntries.map(([e,o])=>({key:e,name:o.name,api:o.api,detail:o.detail,from:"config",disabled:!1}))};storage&&"function"==typeof storage.setAdminConfig&&await storage.setAdminConfig(adminConfig),null==cachedConfig&&(cachedConfig=adminConfig),cachedConfig.SiteConfig=adminConfig.SiteConfig,cachedConfig.UserConfig=adminConfig.UserConfig,cachedConfig.SourceConfig=adminConfig.SourceConfig}async function getCacheTime(){return(await getConfig()).SiteConfig.SiteInterfaceCacheTime||7200}async function getAvailableApiSites(e=!1){let o=await getConfig();if(!o.SourceConfig||!Array.isArray(o.SourceConfig))return console.warn("SourceConfig is missing or not an array, returning empty array"),[];let t=o.SourceConfig.filter(e=>!e.disabled).map(e=>({...e,is_adult:!0===e.is_adult}));return e&&(t=t.filter(e=>!e.is_adult)),t.map(e=>({key:e.key,name:e.name,api:e.api,detail:e.detail}))}async function getFilteredApiSites(e){let o=await getConfig();if(!o.SourceConfig||!Array.isArray(o.SourceConfig))return console.warn("SourceConfig is missing or not an array, returning empty array"),[];let t=!0;if(e)try{let o=(0,_db__WEBPACK_IMPORTED_MODULE_0__.cF)(),n=await o.getUserSettings(e);t=n?.filter_adult_content!==!1}catch(e){console.warn("Failed to get user settings, using default filter:",e)}let n=o.SourceConfig.filter(e=>!e.disabled).map(e=>({...e,is_adult:!0===e.is_adult}));return t&&(n=n.filter(e=>!e.is_adult)),n.map(e=>({key:e.key,name:e.name,api:e.api,detail:e.detail}))}async function getAdultApiSites(){let e=await getConfig();return e.SourceConfig&&Array.isArray(e.SourceConfig)?e.SourceConfig.filter(e=>!e.disabled&&!0===e.is_adult).map(e=>({key:e.key,name:e.name,api:e.api,detail:e.detail})):(console.warn("SourceConfig is missing or not an array, returning empty array"),[])}},80540:(e,o,t)=>{t.d(o,{Z:()=>n});let n={cache_time:7200,api_site:{hnzy:{api:"https://hnzyapi.com/api.php/provide/vod",name:"火鸟资源",is_adult:!1},lzzy:{api:"https://api.liangzizy.com/inc/apijson_vod.php",name:"量子资源",is_adult:!1},ffzy:{api:"https://ffzyapi.com/api.php/provide/vod",name:"非凡资源",is_adult:!1},ykzy:{api:"https://api.yongjiuzy.cc/provide/vod",name:"永久资源",is_adult:!1},bdzy:{api:"https://api.1080zyku.com/inc/apijson_vod.php",name:"百度资源",is_adult:!1}}}}};var __webpack_require__=require("../../../webpack-runtime.js");__webpack_require__.C(exports);var __webpack_exec__=e=>__webpack_require__(__webpack_require__.s=e),__webpack_exports__=__webpack_require__.X(0,[7796,9864,3001,6257],()=>__webpack_exec__(36282));module.exports=__webpack_exports__})(); \ No newline at end of file