Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(media): transcode incompatible playback on demand and use portrait fallback

Codexc38865603385
diff --git a/docs/REUSE.md b/docs/REUSE.md
index a4f3bd146..543152886 100644
--- a/docs/REUSE.md
+++ b/docs/REUSE.md
@@ -102,7 +102,7 @@ CloudDrive 为外部应用,本项目不捆绑其二进制或依赖其管理 AP
| 已确认厂牌的目录归位 | Javinizer-Go v1.5.1 organizer 只作冲突预检、模板化目录和回滚边界参考,不让它持有 Peach ledger | `rehome_unknown_jav.py` 只消费人工确认映射;先出逐文件 CSV,拒绝扁平化重名与厂牌冲突,SQLite 备份后移动文件并同步 Peach 路径/实体 provenance |
| FC2 目录元数据与跨号证据 | 已缓存的 fc2cmadb Inertia `article`/评论收获;Javinizer-Go v1.5.1 的 FC2 解析器只作官方商品页字段边界参考 | 2026-08-31 登录态实测旧文章仍提供标题、原始标签、日期、时长、卖家、FC2 CDN 封面与 `comments`;Peach 只把无歧义标签翻译成现有词表,标题/标签进入 `/review`,实测 `w1200` 封面经尺寸与解码门槛落生成产物;稳定 pair、合集/分片保护、hash/时长/尺寸佐证、库外 evidence、健康统计和人工复核仍由 Peach 管,不依赖 FC2-Leak-Detector/JavSP,也不把镜像候选直写 ledger |
| 媒体探测/转码 | Peach 管理的 FFmpeg/ffprobe;Windows 已实测 FFmpeg 9.0.1 full build 的 CUDA/NVDEC、`scale_cuda` 与 NVENC,现有二进制启用 GPL/version3 | 任务策略和 Media Engine 编排:容器与内部编码分别检查,MP4/M4V 的 H.264 8-bit 与兼容音轨可直出;其余容器中的 H.264 8-bit 优先只换 MP4 封装;其余 Windows 输入依次尝试 CUDA→H.264 NVENC、软件解码→NVENC、原 `libx264` 回退,macOS 保持封装复制或软件转码。2026-09-05 的 JBS-023 原片为 MPEG-4 Part 2/AAC,12 秒样本经既有 FFmpeg 链路在 2.42 秒输出 H.264/AAC 并通过画面解码;兼容性依据为 MDN Web video codec guide 与 ffprobe 官方 stream 文档。真实 CloudDrive POC 中,H.264/AAC 的 30 秒片段封装耗时 0.64 秒,1080p HEVC 的 30 秒 CUDA/NVENC 转码耗时 1.60 秒;不新增依赖,不改原媒体或 ledger。 |
-| HTML5/HLS/DASH 播放 | Video.js 8.24.0 + 内置 VHS(Apache-2.0,本地固定版本) | 流方案、授权、稳定时长、回退顺序和统计面板 |
+| HTML5/HLS/DASH 播放 | Video.js 8.24.0 + 内置 VHS(Apache-2.0,本地固定版本) | 流方案、授权、稳定时长、回退顺序和统计面板;详情不兼容片源复用 HlsSegmentService 与 FFmpeg 按六秒编码 H.264/AAC,独立缓存、绝对时间轴及会话取消;JBS-023 首段 0.67 秒、十分钟处 1.96 秒,YRH-097 首段 1.01 秒,无整片预转码 |
| 播放器设置与影院布局 | Video.js 8.24.0 的 `playbackRate`、既有 QualityLevel、原生 tooltip 与控制栏插槽;YouTube `e937390a` 实际 DOM/CSS/JS 提供可复现的几何、状态、动画和图形证据 | Peach 在现有 DOM 上组合氛围模式、播放速度、真实清晰度和影院模式,并复用 59 px 两排控制栏、40→111 px 横向音量、4→6 px 进度动画、右侧共享胶囊、整行悬停的 274 px 设置菜单和视口级全屏;普通视图 `contain` 保全片源,全屏按用户明确要求改用 `cover` 铺满视口,接受非等比例片源的边缘裁切。全屏命中同时使用 Video.js/原生类和 `isFullscreen()` 同步的 `data-peach-fullscreen`,并覆盖 `body.vjs-full-window` 回退,不能再靠单个 CSS 类推断运行态;标准、WebKit、Gecko 等浏览器专用伪类必须放进 forgiving `:is(...)` 或拆成独立规则,不能在普通 selector list 混写后让某浏览器因未知伪类废掉整组声明。用户要求精准图形的设置项、radio 选中勾、菜单箭头、中央 bezel 与 loading 只 vendoring 当前锁定版本的 SVG path/spinner 结构,音量 hover 与滑轨中心沿用上游外层伪元素和 50% 几何,tooltip 仅补 Peach 两排控制栏需要的显式层级与越界可见;不复制播放器控制逻辑、不迁移到 Video.js 10 Menu,也不引入重复现有质量选择的插件 |
| 播放器时刻预览 | Video.js 原生进度控件 + Peach 既有 `/poster?id=&c=0…8` 九宫格切片 | 本地媒体用已有接触表提供近似时刻缩略图;在线视频只显示时刻。`videojs-vtt-thumbnails` 与 `videojs-sprite-thumbnails` 都要求另建 sprite/VTT 契约,本项目不为已有能力新增依赖或重复抽帧 |
| 分卷文件命名 | [Plex 官方命名](https://support.plex.tv/articles/naming-and-organizing-your-movie-media-files/)的 `cd/disc/disk/dvd/part/pt + 数字` 与 [Kodi 官方 File Stacking](https://kodi.wiki/view/File_stacking)只作行为证据;运行时复用当前树的 `part_marker`,不新增扫描器依赖 | 兼容馆藏已有的裸数字和 A–H 后缀;仅连续、唯一标记自动合卡,保留每个 asset 和播放会话,不拼接或改写媒体 |
diff --git a/docs/STATUS.md b/docs/STATUS.md
index b7894ed29..aa09589e7 100644
--- a/docs/STATUS.md
+++ b/docs/STATUS.md
@@ -26,7 +26,7 @@
一条一句,不带日期,只写别处没有的判据:README、`docs/HANDOFF.md`、`docs/REUSE.md`、
`docs/OPERATIONS.md` 和 ADR 已经写下的不在这里重复,出处用 `git log -S` 查。
-- ffprobe 核对内部编码;`mpeg4/AAC` 实片转 H.264/AAC 后画面解码通过,原媒体不改。
+- 不兼容视频按六秒片段转 H.264/AAC;29999、30005 实片首段及跳播解码通过。
- 29999 及另 16 番号、23 视频补齐女优,账本完整。实屏未验。
- 远端 MP4 默认走标准 Range,显式开启的 HLS 使用关键帧对齐片段并在失败时回退 Range。
- 页面共用 SPA、JSON 与 gzip/ETag;侧栏随当前视频集合,已保存在线作品复用关注详情。
diff --git a/scripts/harvest_social_avatars.py b/scripts/harvest_social_avatars.py
index 40b303620..209c8598f 100644
--- a/scripts/harvest_social_avatars.py
+++ b/scripts/harvest_social_avatars.py
@@ -59,7 +59,7 @@ from peach.avatar_provider import ( # noqa: E402
provenance_now,
)
from peach.config import ( # noqa: E402
- DATABASE_PATH, GENERATED_DIR, REVIEW_DIR, STATE_DIR,
+ DATABASE_PATH, GENERATED_DIR, REVIEW_DIR, STATE_DIR, COVER_DIR,
)
from peach.http import HttpRequest, HttpTransport, HttpxTransport # noqa: E402
from peach.review_csv import read_rows, write_rows # noqa: E402
@@ -73,7 +73,7 @@ X_HOSTS = ("x.com", "twitter.com", "mobile.twitter.com")
AGGREGATOR_HOSTS = ("lit.link", "linktr.ee", "allmylinks.com", "twpf.jp")
BLOG_HOSTS = ("ameblo.jp", "lineblog.me", "note.com", "livedoor.jp", "hatenablog.com")
#: 候选的 provider 归到哪个内容寻址缓存。
-PROVIDER_CACHES = {"social-web": "social", "babepedia": "babepedia", "jae": "jae"}
+PROVIDER_CACHES = {"social-web": "social", "babepedia": "babepedia", "jae": "jae", "cover-fallback": "cover"}
SOCIAL_LABELS = {
("instagram.com",): "Instagram",
("threads.net", "threads.com"): "Threads",
@@ -377,7 +377,7 @@ def load_targets(connection: sqlite3.Connection, avatar_dir: Path,
routes["babepedia"] = babe[entity_id]
if entity_id in jae:
routes["jae"] = jae[entity_id]
- if not routes:
+ if not routes and kind != "performer":
continue
targets.append({**info, "routes": routes})
return targets
@@ -553,6 +553,38 @@ def harvest_entity(record: dict, http: HttpTransport, limiter: HostLimiter,
return {"links": links, "candidates": candidates, "notes": notes}
+def cover_fallback(connection, record: dict, cache: AvatarCandidateCache,
+ cover_root: Path = COVER_DIR) -> dict | None:
+ """仅使用已关联的单人作品封面,保留完整大图和来源。"""
+ if record["kind"] != "performer":
+ return None
+ candidates = []
+ for (code,) in connection.execute(
+ "SELECT DISTINCT a.code FROM asset a JOIN asset_entity ae ON ae.asset_id=a.id "
+ "WHERE ae.entity_id=? AND ae.role='performer' AND coalesce(a.code,'')<>'' "
+ "AND (a.disposal IS NULL OR a.disposal<>'trash') "
+ "AND NOT EXISTS(SELECT 1 FROM asset_entity other WHERE other.asset_id=a.id "
+ "AND other.role='performer' AND other.entity_id<>ae.entity_id)", (record["entity_id"],)):
+ if not re.fullmatch(r'[A-Za-z0-9-]+', code):
+ continue
+ path = cover_root / f'{code}.jpg'
+ if not path.is_file():
+ continue
+ data = path.read_bytes()
+ inspected = inspect_avatar(data)
+ if inspected is None or not passes_auto_bar(inspected.width, inspected.height):
+ continue
+ source = path.resolve().as_uri()
+ stored = cache.store(source, data, inspected)
+ candidates.append(dict(provider='cover-fallback', source_kind='single_performer_cover',
+ source_url=source, external_id=code, width=inspected.width,
+ height=inspected.height, mime_type=inspected.mime_type,
+ sha256=inspected.sha256, object_path=stored,
+ matched=record['canonical'], name_source='ledger-performer',
+ evidence=f'单人作品 {code} 完整封面'))
+ return max(candidates, key=lambda r: r['width'] * r['height']) if candidates else None
+
+
def select_winner(candidates: list[dict]) -> tuple[dict | None, list[dict]]:
"""同图去重(SHA-256 相同 = 同一张图的不同档位/不同平台),取最大的最清晰的。
@@ -686,6 +718,7 @@ def run(args) -> int:
"social": AvatarCandidateCache(args.cache_root / "social"),
"babepedia": AvatarCandidateCache(args.cache_root / "babepedia"),
"jae": AvatarCandidateCache(args.cache_root / "jae"),
+ "cover": AvatarCandidateCache(args.cache_root / "cover"),
}
candidate_rows: list[dict] = []
install_rows: list[dict] = []
@@ -728,6 +761,13 @@ def run(args) -> int:
review_rows.append(row)
winner, runners_up = select_winner(result["candidates"])
+ if (winner is None or not winner.get('matched')
+ or not passes_auto_bar(winner['width'], winner['height'])):
+ fallback = cover_fallback(connection, record, caches['cover'])
+ if fallback:
+ if winner:
+ runners_up.append(winner)
+ winner = fallback
for candidate in ([winner] if winner else []) + runners_up:
cache = caches[PROVIDER_CACHES[candidate["provider"]]]
provenance_path = cache.store_provenance(
diff --git a/src/peach/routes_media.py b/src/peach/routes_media.py
index 58eb38059..bf8d975ab 100644
--- a/src/peach/routes_media.py
+++ b/src/peach/routes_media.py
@@ -101,14 +101,15 @@ def _hls_plan(state, asset_id: int, session: str = ""):
asset = state.media_engine.asset(asset_id)
# 播放列表和分片端点本身就是 HLS 路径,按 ADR-0016 显式要计划,不受默认值影响。
choice = state.media_engine.stream_plan(asset_id, mode="hls")
- if choice.protocol != "hls" or not asset.duration:
+ if not asset.duration:
return None
source = state.media_engine.filesystem.file_for(asset, thumbnail=False)
- source, _ = state.transcode_service.browser_path(
- asset_id, source, session=session, registry=state.stream_sessions,
- )
+ if state.transcode_service.requires_conversion(source, session=session, registry=state.stream_sessions):
+ return asset, source, state.hls_service.conversion_plan(asset.duration), True
+ if choice.protocol != "hls":
+ return None
plan = state.hls_service.plan(source, asset.duration)
- return None if not plan else (asset, source, plan)
+ return None if not plan else (asset, source, plan, False)
@router.api_route("/stream", methods=["GET", "HEAD"])
@@ -148,12 +149,15 @@ def stream_plan(request: Request, id: int, session: str = "", mode: str = "", ar
asset = state.media_engine.asset(id)
plan = state.media_engine.stream_plan(id, mode=mode or "auto")
# 只有真的能读出关键帧才宣告 HLS,否则客户端会拿到一个必然 404 的播放列表。
- resolved = _hls_plan(state, id) if plan.protocol == "hls" else None
+ source_path = state.media_engine.filesystem.file_for(asset, thumbnail=False)
+ conversion = state.transcode_service.requires_conversion(
+ source_path, session=session, registry=state.stream_sessions)
+ resolved = _hls_plan(state, id, session) if conversion or plan.protocol == "hls" else None
if resolved and session:
return {
"id": id,
"protocol": "hls",
- "mime_type": plan.mime_type,
+ "mime_type": "application/vnd.apple.mpegurl",
"duration": asset.duration,
"segment_seconds": plan.segment_seconds,
"segments": len(resolved[2]),
@@ -211,13 +215,14 @@ async def hls_segment(request: Request, id: int, index: int, session: str = "",
)
if resolved is None:
return JSONResponse({"error": "hls unavailable"}, status_code=404)
- _, source, plan = resolved
+ _, source, plan, conversion = resolved
if index < 0 or index >= len(plan):
return JSONResponse({"error": "invalid segment"}, status_code=416)
start, duration = plan[index]
path = await state.hls_service.generate(
source, start, duration, asset_id=id, index=index,
session=session, registry=state.stream_sessions,
+ **({"transcode": True} if conversion else {}),
)
except SegmentCancelled:
return Response(status_code=410, headers={"Cache-Control": "no-store"})
diff --git a/src/peach/segments.py b/src/peach/segments.py
index 7ad471cbf..fa1c82cc7 100644
--- a/src/peach/segments.py
+++ b/src/peach/segments.py
@@ -2,6 +2,7 @@
from __future__ import annotations
import asyncio
+import math
import os
import subprocess
import uuid
@@ -92,9 +93,15 @@ class HlsSegmentService:
self._plans[key] = result
return result or None
- def cached_path(self, source: Path, asset_id: int, index: int) -> Path:
+ def cached_path(self, source: Path, asset_id: int, index: int, *, transcode: bool = False) -> Path:
_, size, mtime = self.fingerprint(source)
- return self.work_root / str(asset_id) / f"{size}-{mtime}-{self.segment_seconds}" / f"{index}.ts"
+ flavor = '-h264-v1' if transcode else ''
+ return self.work_root / str(asset_id) / f"{size}-{mtime}-{self.segment_seconds}{flavor}" / f"{index}.ts"
+
+ def conversion_plan(self, duration: float) -> list[tuple[float, float]]:
+ """编码片段各自以关键帧开始,覆盖完整的播放时间轴。"""
+ return [(float(start), min(float(self.segment_seconds), duration - start))
+ for start in range(0, math.ceil(duration), self.segment_seconds)]
def _evict(self) -> None:
files = [item for item in self.work_root.rglob("*.ts") if item.is_file()]
@@ -128,8 +135,9 @@ class HlsSegmentService:
index: int,
session: str,
registry: StreamSessionRegistry,
+ transcode: bool = False,
) -> Path:
- target = self.cached_path(source, asset_id, index)
+ target = self.cached_path(source, asset_id, index, transcode=transcode)
if target.is_file() and target.stat().st_size:
os.utime(target, None) # 命中即续期,淘汰按最后访问时间
return target
@@ -153,6 +161,16 @@ class HlsSegmentService:
"-copyts", "-muxdelay", "0", "-muxpreload", "0",
"-f", "mpegts", str(temporary),
]
+ if transcode:
+ command = [
+ str(choice.path), "-hide_banner", "-loglevel", "error", "-nostdin", "-y",
+ "-ss", f"{start:.3f}", "-i", str(source), "-t", f"{duration:.3f}",
+ "-map", "0:v:0", "-map", "0:a:0?", "-sn", "-dn",
+ "-c:v", "libx264", "-preset", "veryfast", "-crf", "21",
+ "-pix_fmt", "yuv420p", "-threads", "2", "-c:a", "aac", "-b:a", "160k",
+ "-output_ts_offset", f"{start:.3f}", "-muxdelay", "0", "-muxpreload", "0",
+ "-f", "mpegts", str(temporary),
+ ]
creationflags = subprocess.CREATE_NO_WINDOW if os.name == "nt" else 0
process = None
successful = False
diff --git a/src/peach/transcodes.py b/src/peach/transcodes.py
index aae65f2ca..f2ab4d770 100644
--- a/src/peach/transcodes.py
+++ b/src/peach/transcodes.py
@@ -65,6 +65,26 @@ class TranscodeService:
def needs_transcode(source: Path) -> bool:
return source.suffix.lower() not in BROWSER_NATIVE_SUFFIXES
+ def requires_conversion(self, source: Path, *, session: str = "", registry=None) -> bool:
+ """按容器和内部编码选择浏览器兼容路径,不生成整片缓存。"""
+ if self.needs_transcode(source):
+ return True
+ if self.resolver.ffprobe() is None:
+ return False
+ stat = source.stat()
+ key = (str(source), stat.st_size, stat.st_mtime_ns)
+ with self._locks_guard:
+ profile = self._native_profiles.get(key)
+ if profile is None:
+ profile = self._probe(source, session, registry,
+ time.monotonic() + PROBE_TIMEOUT_SECONDS)
+ if profile is not None:
+ with self._locks_guard:
+ if len(self._native_profiles) >= 512:
+ self._native_profiles.pop(next(iter(self._native_profiles)))
+ self._native_profiles[key] = profile
+ return profile is None or not self._browser_compatible(source, profile)
+
def browser_path(
self, asset_id: int, source: Path, *, session: str = "", registry=None,
) -> tuple[Path, bool]:
diff --git a/tests/test_fastapi_api.py b/tests/test_fastapi_api.py
index 254675c13..07beccc29 100644
--- a/tests/test_fastapi_api.py
+++ b/tests/test_fastapi_api.py
@@ -1214,6 +1214,20 @@ class FastApiContractTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(playlist.headers["content-type"], "application/vnd.apple.mpegurl")
self.assertEqual(playlist.text.count("#EXTINF:"), 3)
+ async def test_incompatible_video_uses_time_slices_without_whole_movie_conversion(self):
+ con = sqlite3.connect(self.db)
+ con.execute("UPDATE asset SET duration=7632.28 WHERE id=1")
+ con.commit()
+ con.close()
+ with patch.object(self.app.state.transcode_service, 'requires_conversion', return_value=True), \
+ patch.object(self.app.state.transcode_service, 'browser_path',
+ side_effect=AssertionError('whole movie conversion')):
+ response = await self.client.get('/api/stream-plan?id=1&session=s&t=secret')
+ self.assertEqual(response.json()['protocol'], 'hls')
+ playlist = await self.client.get('/stream/hls/1/index.m3u8?session=s&t=secret')
+ self.assertEqual(playlist.status_code, 200)
+ self.assertIn('#EXTINF:0.280', playlist.text)
+
async def test_hls_segment_is_generated_for_one_requested_time_slice(self):
con = sqlite3.connect(self.db)
con.execute("UPDATE asset SET location='115', duration=13.5, path=? WHERE id=1",
diff --git a/tests/test_segments.py b/tests/test_segments.py
index 721bafa3a..d37d9a225 100644
--- a/tests/test_segments.py
+++ b/tests/test_segments.py
@@ -99,7 +99,7 @@ class SegmentCommandTests(unittest.TestCase):
也拖不动。缓存目录里三个资产都只留下 0.ts 和 1.ts,没有更靠后的片段。
"""
- def _command_for(self, index: int) -> list[str]:
+ def _command_for(self, index: int, transcode: bool = False) -> list[str]:
captured: list[list[str]] = []
class _Process:
@@ -141,6 +141,7 @@ class SegmentCommandTests(unittest.TestCase):
source, round(index * 9.993, 3), 9.993,
asset_id=6562, index=index, session="s",
registry=StreamSessionRegistry(),
+ transcode=transcode,
)
except Exception:
pass
@@ -149,6 +150,13 @@ class SegmentCommandTests(unittest.TestCase):
self.assertTrue(captured, "没有真的调用 FFmpeg")
return captured[0]
+ def test_conversion_slice_has_bounded_duration_and_absolute_output_timeline(self):
+ command = self._command_for(100, transcode=True)
+ self.assertEqual(command[command.index('-c:v')+1], 'libx264')
+ self.assertEqual(command[command.index('-t')+1], '9.993')
+ self.assertEqual(command[command.index('-output_ts_offset')+1], '999.300')
+ self.assertNotIn('-copyts', command)
+
def test_silent_ffmpeg_failure_still_says_what_was_observed(self):
"""FFmpeg 可以退出码 0、stderr 全空却写出 0 字节,只报 ffmpeg failed 等于没报。"""
from peach.segments import SegmentUnavailable
diff --git a/tests/test_social_avatar_harvest.py b/tests/test_social_avatar_harvest.py
index 2cdb94ce5..0b55113de 100644
--- a/tests/test_social_avatar_harvest.py
+++ b/tests/test_social_avatar_harvest.py
@@ -28,6 +28,27 @@ def jpeg(width=400, height=400, color=(200, 30, 30)):
return buffer.getvalue()
+class CoverFallbackTests(unittest.TestCase):
+ def test_single_performer_cover_is_used_and_multi_performer_cover_is_excluded(self):
+ module = load_module()
+ with tempfile.TemporaryDirectory() as tmp:
+ root = Path(tmp).resolve()
+ (root / 'JBS-023.jpg').write_bytes(jpeg(1000, 700))
+ con = sqlite3.connect(':memory:')
+ con.executescript("CREATE TABLE asset(id,code,disposal);"
+ "CREATE TABLE asset_entity(asset_id,entity_id,role);"
+ "INSERT INTO asset VALUES(1,'JBS-023',NULL);"
+ "INSERT INTO asset_entity VALUES(1,5,'performer');")
+ record = dict(kind='performer',entity_id=5,canonical='风见步')
+ cache = module.AvatarCandidateCache(root/'cache')
+ result = module.cover_fallback(con, record, cache, root)
+ self.assertEqual(result['source_kind'], 'single_performer_cover')
+ self.assertEqual((result['width'], result['height']), (1000,700))
+ con.execute("INSERT INTO asset_entity VALUES(1,6,'performer')")
+ self.assertIsNone(module.cover_fallback(con, record, cache, root))
+ con.close()
+
+
X_BASE = "https://pbs.twimg.com/profile_images/2033362507679850496/4wvXoOFw"
X_PAGE = f"""
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 3454f5279..7e05daa72 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -2487,6 +2487,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("keepalive:true")
self.assertPageContains("dataset.peachStreamCancel=JSON.stringify(result)")
self.assertPageContains("/api/stream-plan?id=")
+ self.assertNotIn("if(!['115','pikpak'].includes(it.location))return direct", self.app_js)
self.assertPageContains("const source=()=>options.source?Promise.resolve(options.source):detailStreamSource(it)")
self.assertPageContains("source().then(next=>")
self.assertPageContains("fallbackUsed=false")
diff --git a/web/app.js b/web/app.js
index 118adeaf9..ca96c1d12 100644
--- a/web/app.js
+++ b/web/app.js
@@ -774,7 +774,6 @@ async function detailStreamSource(it){
const proxied=followStreamSource(it);
if(proxied)return proxied;
const direct=directDetailSource(it);
- if(!['115','pikpak'].includes(it.location))return direct;
try{
const plan=await api(`/api/stream-plan?id=${it.id}&session=${encodeURIComponent(detailStreamSession)}`);
if(plan.protocol==='hls'&&plan.src)return {src:plan.src,type:plan.mime_type||'application/vnd.apple.mpegurl'};