Skip to content

v0.2.3 — Live-stream safety & smarter probing

Choose a tag to compare

@realzza realzza released this 14 Jul 05:22
800e6ef

A correctness and coverage release: live streams are now safe, server probing got honest, and more PCDN families are caught. No UI changes, no settings changed. Update and reload any open Bilibili tab.

What changed

  • Live streams are now safe. Live playback runs on a separate CDN tier, and the old heuristics could rewrite a live stream's address to a video-on-demand server that can't serve it. Live addresses are now never rewritten; instead, PCDN/MCDN nodes are filtered out of the live room's server list so the live player only connects to official CDN servers (and the last usable server is never removed).
  • Smarter server probing. Probes now read the real HTTP status — a server that fails fast can no longer win the "fastest server" ranking — and stop the download right after timing the response. Previously each probe silently pulled full video segments from every candidate in parallel.
  • More hidden PCDN caught. upos-*302* redirect hosts, the residential-node domains they land on, *.edge.mountaintoys.cn explicitly, and PCDN servers hiding behind mirror-style names — all flagged regardless of port.
  • Fewer escapes. Requests made with URL objects, protocol-relative addresses, bangumi payloads, and legacy durl playlists are all covered now.
  • Stall recovery that keeps trying. Recovery now tracks the server that actually stalled and keeps rotating while buffering persists, instead of switching exactly once.
  • Bandwidth guard hardening. The opt-in guard also disables Bilibili's P2P SDK entry points.

Verified against production: on the known-stuttery test video, the script rewrote 18 URLs from the slow overseas mirror to a healthy one, and the rewritten address served immediately; the live filter was run against a real live-room response and correctly left official servers untouched.


更新内容(中文)

一次正确性与覆盖率升级:直播不再误伤、测速更诚实、识别更多 PCDN 家族。界面与设置均无变化,更新后刷新已打开的 B 站页面即可。

  • 直播不再误伤。 直播走的是独立的 CDN 体系,旧版的启发式规则可能把直播地址改写到根本放不了直播的点播服务器上。现在直播地址一律不改写,改为从直播间的服务器列表里过滤 PCDN/MCDN 节点,让直播播放器只连官方 CDN(且永远不会移除最后一个可用服务器)。
  • 测速更聪明。 探测候选服务器时会读取真实 HTTP 状态——秒回错误的服务器不会再赢得「最快服务器」排名——并在拿到响应后立刻停止下载。旧版每次探测会从所有候选服务器并行拉取完整视频分片。
  • 识别更多隐藏 PCDN。 upos-*302* 跳转节点及其落地的家用宽带域名、明确列入的 *.edge.mountaintoys.cn、伪装成镜像名的 PCDN 服务器——无论端口如何都会被识别。
  • 漏网更少。 URL 对象请求、协议相对地址、番剧返回、老式 durl 播放列表全部覆盖。
  • 卡顿恢复更执着。 现在记录真正卡住的服务器,持续缓冲时不断轮换,而不是只切一次。
  • 带宽保护加固。 可选的带宽保护同时禁用 B 站 P2P SDK 入口。

已对线上环境验证:在已知卡顿的测试视频上,脚本把 18 个地址从慢速海外镜像改写到健康镜像,改写后的地址立即可用;直播过滤器已用真实直播间返回验证,官方服务器不受影响。