From d885670cfe071173e4ce4c672e6e3a53db5b1689 Mon Sep 17 00:00:00 2001 From: jinghui Date: Mon, 26 Oct 2026 10:31:08 +0800 Subject: [PATCH] =?UTF-8?q?v-fixed16=EF=BC=9A=E4=BF=AE=E5=A4=8D=20/live=20?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=20JSON=EF=BC=88rewrite=20=E4=B8=A2=20query?= =?UTF-8?q?=20=E6=94=B9=E6=8C=89=20pathname=20=E8=AF=86=E5=88=AB=EF=BC=89?= =?UTF-8?q?=EF=BC=9B=E5=B8=83=E5=B1=80=E6=94=B9=E4=B8=BA=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E9=80=89=E5=8F=B0=E5=8F=B3=E4=BE=A7=E6=92=AD=E6=94=BE=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E6=92=AD=E6=94=BE=E4=B8=AD=E5=8A=A0=E8=BD=BD=E9=81=AE?= =?UTF-8?q?=E7=BD=A9=E8=AF=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 +++++++ docker-compose.redis.yml | 2 +- patches/inject_live.py | 11 ++++++++--- patches/live-inject.js | 10 ++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63b85b..80b6ff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 格式参考本机发版惯例:按日期分条,`🐛修复` / `✨新功能`。 +## 2026-10-26 → v-fixed16 + +- 🐛 **修复 `/live` 打开是代码(JSON)**:Next 的 rewrite 到 API 路由时保留原 URL `/live`、静态 query 全丢,导致直播钩子不触发而返回 TVBOX config JSON;改为按 `pathname === "/live"` 识别(实测登录态返回 `text/html`) +- ✨ **布局改为左台右播**:频道列表固定左侧(320px、可滚动、51 频道),播放器右侧 16:9;手机端频道列表限高 36vh 在上、点选后自动平滑滚动到播放器 +- 🐛 修复播放中仍盖"加载中"遮罩的问题(缓冲波动时误显示;现在仅在真正暂停时显示) +- 🔧 频道列表标题加「点击切换」提示 + ## 2026-10-26 → v-fixed15 - ✨ **直播接入 TVBOX/影视仓**:配置接口 `/api/tvbox` 的 `lives` 字段(原指向不存在的死链)改指频道文本源 `?live=txt` —— 影视仓里现有配置地址不用改,重新加载即自动多出「电视直播」直播栏 diff --git a/docker-compose.redis.yml b/docker-compose.redis.yml index 913db85..8ff5240 100644 --- a/docker-compose.redis.yml +++ b/docker-compose.redis.yml @@ -3,7 +3,7 @@ version: '3.8' services: # KatelyaTV 应用服务 katelyatv: - image: katelyatv:fixed15 + image: katelyatv:fixed16 container_name: katelyatv ports: - "3030:3000" diff --git a/patches/inject_live.py b/patches/inject_live.py index b87627d..13940d3 100644 --- a/patches/inject_live.py +++ b/patches/inject_live.py @@ -7,7 +7,8 @@ RM = "/app/.next/routes-manifest.json" MC = "/app/.next/static/chunks/402-42ae253cc67eee98.js" BASE = os.path.dirname(os.path.abspath(__file__)) MARK_S, MARK_E = "/* ==== LIVE:", "/* ==== LIVE END ==== */" -HOOK = 'try{let _lv=new URL(e.url).searchParams.get("live");if(_lv)return await LIVE(_lv,e)}catch(_le){console.log("[LIVE-HOOK]",_le&&_le.message)}' +HOOK_OLD = 'try{let _lv=new URL(e.url).searchParams.get("live");if(_lv)return await LIVE(_lv,e)}catch(_le){console.log("[LIVE-HOOK]",_le&&_le.message)}' +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() @@ -31,8 +32,12 @@ if MARK_S not in src: a = 'async function u(e){console.log("[TVBOX-REQ]",e.method,e.url);' assert src.count(a) == 1, "anchor B" if HOOK not in src: - src = src.replace(a, a + HOOK, 1) - print("entry hook injected") + if HOOK_OLD in src: + src = src.replace(HOOK_OLD, HOOK, 1) + print("entry hook upgraded (pathname /live)") + else: + src = src.replace(a, a + HOOK, 1) + print("entry hook injected") 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) diff --git a/patches/live-inject.js b/patches/live-inject.js index 617058f..d244d49 100644 --- a/patches/live-inject.js +++ b/patches/live-inject.js @@ -63,8 +63,9 @@ body{background:#0f1115;color:#e5e7eb;font-family:-apple-system,BlinkMacSystemFo .hd{position:sticky;top:0;z-index:9;background:rgba(15,17,21,.92);backdrop-filter:blur(8px);padding:10px 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #1f2430} .hd a{color:#9ca3af;text-decoration:none;font-size:24px;line-height:1} .hd h1{font-size:17px;font-weight:600} -.wrap{max-width:1100px;margin:0 auto;padding:14px;display:flex;flex-direction:column;gap:14px} -@media(min-width:820px){.wrap{flex-direction:row}.side{width:300px;flex:none;max-height:78vh;overflow:auto}.main{flex:1}} +.wrap{max-width:1180px;margin:0 auto;padding:14px;display:flex;flex-direction:column;gap:14px} +.side{max-height:36vh;overflow:auto;padding-right:2px} +@media(min-width:820px){.wrap{flex-direction:row;align-items:flex-start}.side{width:320px;flex:none;max-height:78vh}.main{flex:1;min-width:0}} .player-box{background:#000;border-radius:10px;overflow:hidden;aspect-ratio:16/9;position:relative} video{width:100%;height:100%;display:block;background:#000} .tip{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#6b7280;font-size:14px;pointer-events:none;background:rgba(0,0,0,.35)} @@ -80,12 +81,12 @@ select{background:#171b24;color:#e5e7eb;border:1px solid #2a3140;border-radius:6
‹

电视直播 · 港澳台

+
频道列表 点击切换
加载中…
选择频道开始观看
未选择
-
频道列表
加载中…