### Install dependencies and Chromium for headless server collection Source: https://github.com/zxsos/hghubx/blob/main/docs/playback-diagnostics.md Prerequisite setup for headless server auto-collection. Requires Node.js 22+, pnpm, FFmpeg (with libx264/AAC), and Chromium. ```sh pnpm install --frozen-lockfile pnpm exec playwright-core install --with-deps chromium ``` -------------------------------- ### Run playback diagnostics tests Source: https://github.com/zxsos/hghubx/blob/main/docs/playback-diagnostics.md Generates 90-second HLS media, starts Vite/media server on random localhost port, operates headless browser, and cleans up after. External network requests are blocked and cause failure. ```sh pnpm test:playback ``` -------------------------------- ### 编译 sing-box 二进制规则集(sing-box rule-set compile) Source: https://github.com/zxsos/hghubx/blob/main/rules/README.md 将 hghubx.json 编译为 hghubx.srs,供 sing-box 二进制规则集使用。编译后需将配置中的 format 改为 binary、path 改为 ./rules/hghubx.srs。 ```sh sing-box rule-set compile --output rules/hghubx.srs rules/hghubx.json ``` -------------------------------- ### 生成本地 HLS fixture 并启动测试服务 Source: https://github.com/zxsos/hghubx/blob/main/docs/playback-seek.md 使用 ffmpeg 生成 90 秒 HLS 测试资源,然后启动本地代理服务。需要 FFmpeg 和 Python 3。 ```sh seek_fixture_dir=$(mktemp -d) ffmpeg -hide_banner -loglevel error \ -f lavfi -i testsrc2=size=320x180:rate=15 \ -f lavfi -i sine=frequency=440:sample_rate=44100 -t 90 \ -c:v libx264 -preset ultrafast -g 30 -sc_threshold 0 -pix_fmt yuv420p \ -c:a aac -f hls -hls_time 2 -hls_playlist_type vod \ -hls_segment_filename "$seek_fixture_dir/seg%03d.ts" "$seek_fixture_dir/list.m3u8" python3 tests/serve-seek-media.py "$seek_fixture_dir" ``` -------------------------------- ### Run limited playback regression scenarios Source: https://github.com/zxsos/hghubx/blob/main/docs/playback-diagnostics.md Executes only the specified scenarios (seek, legacy, stall) for focused diagnostics. Fails with exit code 1 on any check failure but retains logs and reports. ```sh pnpm test:playback --scenarios seek,legacy,stall ``` -------------------------------- ### sing-box 规则集配置(route 的 rule_set 与 rules) Source: https://github.com/zxsos/hghubx/blob/main/rules/README.md 将 hghubx.json 作为 source 格式的本地规则集加入 route,并添加路由规则。适用于 sing-box 1.11+;1.10 需要删除路由项中的 action 字段。替换 proxy 为实际出站标签。 ```json { "route": { "rule_set": [ { "type": "local", "tag": "hghubx", "format": "source", "path": "./rules/hghubx.json" } ], "rules": [ { "rule_set": ["hghubx"], "action": "route", "outbound": "proxy" } ] } } ``` -------------------------------- ### Mihomo 规则集配置(rule-providers 与 rules) Source: https://github.com/zxsos/hghubx/blob/main/rules/README.md 将 hghubx.list 作为 classical/text 规则集引入 Mihomo,并添加 RULE-SET 规则。需要把 PROXY 替换为已有代理组名,且规则应放在其他兜底规则之前。也可使用 type: http 并填写实际 url 和更新周期。 ```yaml rule-providers: hghubx: type: file behavior: classical format: text path: ./rules/hghubx.list rules: - RULE-SET,hghubx,PROXY ``` -------------------------------- ### Run MMS-specific diagnostics Source: https://github.com/zxsos/hghubx/blob/main/docs/playback-diagnostics.md Verifies hls.js MMS compatibility fix only. Uses Chromium's real MSE for decoding and buffering, simulates MMS constructors and streaming events. Report marks simulated_mms: true. ```sh pnpm test:playback --scenarios mms ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.