feat: TVBox直播txt接口默认首频道改为TVB翡翠台 (fixed126)
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s

This commit is contained in:
3970260761 committed 2026-11-11 11:24:02 +08:00
1 parent d0a2041d9a
commit 1e32753397
2 files changed
+6 -3

No files matched your search

+2 -2
View File
@@ -35,7 +35,7 @@ RUN find ./src -type f -name "route.ts" -print0 \
ENV DOCKER_ENV=true
# 海报走站内 /api/image-proxy(浏览器直连豆瓣图被拦导致全裂)
ENV NEXT_PUBLIC_IMAGE_PROXY=/api/image-proxy
ENV NEXT_PUBLIC_SITE_VERSION=fixed125
ENV NEXT_PUBLIC_SITE_VERSION=fixed126
ENV NEXT_PUBLIC_ENABLE_REGISTER=true
# For Docker builds, force dynamic rendering to read runtime environment variables.
@@ -56,7 +56,7 @@ ENV HOSTNAME=0.0.0.0
ENV PORT=3000
ENV DOCKER_ENV=true
ENV NEXT_PUBLIC_IMAGE_PROXY=/api/image-proxy
ENV NEXT_PUBLIC_SITE_VERSION=fixed125
ENV NEXT_PUBLIC_SITE_VERSION=fixed126
ENV NEXT_PUBLIC_ENABLE_REGISTER=true
# 从构建器中复制 standalone 输出
+4 -1
View File
@@ -352,8 +352,11 @@ const fu=await liveResolve(id,p);
const loc=(e.headers.get("x-forwarded-proto")||"http")+"://"+(e.headers.get("host")||"localhost:3000")+"/api/tvbox?live=ts&b="+liveB64e(fu);
return new Response(null,{status:302,headers:{"Location":loc,"Cache-Control":"no-store"}})}
if(action==="txt"){const origin=(e.headers.get("x-forwarded-proto")||"http")+"://"+(e.headers.get("host")||"localhost:3000");const chs=await liveChannels();
// TVBox 客户端默认播放列表第一条, 把 TVB翡翠台 排到最前
const rank=function(c){const n=String(c&&c.name||"");return n.indexOf("翡翠")>=0?0:(String(c&&c.id||"")==="5"?0:1)};
const sorted=chs.slice().sort(function(a,b){return rank(a)-rank(b)});
const out=["港澳台直播,#genre#"];
for(const c of chs){out.push(c.name+","+origin+"/api/tvbox?live=ch&id="+c.id+"&p=0");
for(const c of sorted){out.push(c.name+","+origin+"/api/tvbox?live=ch&id="+c.id+"&p=0");
out.push(c.name+","+origin+"/api/tvbox?live=ch&id="+c.id+"&p=1");
out.push(c.name+","+origin+"/api/tvbox?live=ch&id="+c.id+"&p=2")}
return new Response(out.join("\n")+"\n",{headers:{"Content-Type":"text/plain; charset=utf-8","Cache-Control":"no-store"}})}