
Zahori
io.github.josesepulvedapino由 GitHub 帳號 josesepulvedapino 發布v0.1.1更新於 Oct 24, 2026
Find the media stream behind any web page: browser-driven HLS/DASH/MP4 with learnable site profiles
概覽
Zahori 以無頭瀏覽器開啟網頁,找出背後的 HLS、DASH、MP4 或音訊串流,並回傳串流網址與重播所需的請求標頭。
- 可以做什麼
- 解析網頁背後的媒體串流,判斷直播或隨選,並依語言選擇音軌
- 探測網站,並測試、儲存或列出學到的站台設定檔
- 驗證抓到的串流是真實媒體,而非墊檔畫面或廣告片段
- 透過 ffmpeg 重播抓到的標頭來錄製該串流
- 適用情境
- 當某個網頁在一般瀏覽器可播放、卻沒有現成擷取器時適用,例如地方電視台或廣播頁面、直播活動頁與小型影音入口;也適合讓助理為難處理的網站學習並長期保存設定檔。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 22 以上版本。需先安裝一次 Playwright 的 Chromium shell,否則會改用已安裝的 Google Chrome。ffmpeg 為選用,僅用於驗證、下載與探索流程的判定。模型輔助的探索或修復需要 ANTHROPIC_API_KEY、OPENAI_API_KEY、本機 Ollama,或設定 ZAHORI_MODEL。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Zahori,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
zahori
Find the media stream behind any web page.
[CI] [npm version] [node] [license]
A real browser opens the page, dismisses the overlays, presses play, and watches the network until the media request appears. You get the stream URL (HLS, DASH, MP4 or audio) plus the headers needed to replay it.
No per-site configuration. No extractor to wait for. If a browser can play it, zahori can find it.
Table of contents
- Features
- Why zahori
- Install
- CLI
- Library
- Profiles: how zahori learns a site
- Teaching zahori a site
- The oracle
- Responsible use
- API
- Documentation
- Contributing
- License
Features
- Works on any URL, out of the box. A built-in generic flow handles most pages with zero config.
- Real browser engine. Playwright drives a headless browser in the background; consent banners, play buttons and iframe players are handled automatically, in several languages.
- Replay headers included. Referer/Origin/UA/Cookie are captured from the real request, so ffmpeg and friends don't get 403'd.
- HLS-aware. Master vs media playlists, live vs VOD detection, and audio-rendition selection by language for multilingual streams.
- Learnable. Tricky sites become a small JSON profile, saved once, deterministic forever.
- Agent-native (MCP). Your coding agent can probe a site, author a profile, test it and save it.
- Self-healing.
zahori healrepairs a profile when the site changes, using a BYO-key model, verified by an objective oracle before anything is saved. - DRM-refusing by design. Protected content is detected and rejected, always.
Why zahori
The long tail of the web streams through embedded players that no downloader knows: local TV and radio stations, live event pages, small video portals. yt-dlp is superb for the big platforms it curates extractors for. But the long tail has no extractor, and hand-writing one per site doesn't scale.
They are complementary: use yt-dlp for YouTube, use zahori for the page nobody wrote an extractor for.
Install
Requirements
pnpm users: pnpm blocks dependency build scripts by default, so Playwright won't auto-download a browser. Run the
playwright installline above once, or your system Chrome is used as a fallback.
CLI
The --json output looks like this:
Resolved URLs are often signed and short-lived. zahori re-derives the stream fresh on every run, so use the URL immediately and never store it.
Library
Pass stream.headers to whatever fetches the URL. With ffmpeg:
Errors are typed: NoStreamError (nothing captured) and DrmError (protected content, refused).
Bring your own browser
For sites behind a login, drive zahori inside a Playwright context you control (e.g. one with storage state):
Profiles: how zahori learns a site
zahori ships zero site knowledge. Most pages resolve with the built-in generic flow. When one doesn't, the fix is a profile: a small JSON file describing how to open that site (which elements to click, how to recognize the media request, which candidate to pick). Profiles are data, not code; the engine interprets them deterministically, with no AI at runtime.
Profiles live in .zahori/profiles/ in your project (commit them, so they travel to production and teammates) or ~/.zahori/profiles/ globally. A profile stores how to re-derive the stream, never a stream URL, so signed or expiring URLs are never a problem.
Teaching zahori a site
With your coding agent (MCP)
zahori is an MCP server: any MCP-capable agent can probe a site, propose a profile, test it against the oracle, and save it when it passes, using the subscription you already have and no API key. The server sends its workflow instructions to the agent during the protocol handshake, so this works the same in every client.
Most clients take the standard config:
Then ask: "figure out the stream on https://tricky.example.org and save a profile". Tools exposed: zahori_get, zahori_probe, zahori_test_profile, zahori_save_profile, zahori_validate, zahori_list_profiles.
Headless, with your own key
For unattended pipelines (cron, CI), zahori can drive a model itself. It always tries the free deterministic path first and only spends tokens when that fails:
Model specs: anthropic:<model>, openai:<model>, ollama:<model>, compat:<model> (any OpenAI-compatible endpoint), or set ZAHORI_MODEL once. The model only proposes profiles; the engine runs each proposal and the oracle grades it, so nothing unverified is ever saved.
The oracle
"Did anything download" is a weak test: it blesses ad bumpers, hold music and geo-block slates. The oracle combines stronger signals before trusting a stream.
- Decode probe. ffmpeg decodes a bounded window and measures volume.
- Manifest sanity. A real session has many segments; a slate has four.
- Silence tolerance. A silent window triggers a second probe further in (silence can be a legitimate recess), and silence alone never fails a stream.
- Loud failures. 403/401 responses are reported as header problems, not mysteries.
Verdicts are pass, fail or inconclusive; discovery only saves profiles the oracle passes.
Responsible use
zahori is built for publicly accessible, unprotected streams: pages that already play for any visitor in a normal browser. It resolves what the browser already plays; it does not break into anything.
By design, zahori refuses DRM. Widevine, PlayReady and FairPlay markers are detected in the manifest and rejected with an explicit DrmError. It never attempts to bypass encryption or access controls; this is a hard line, not a setting.
The safe perimeter. The clearest ground is open HLS/DASH that a site serves to every visitor, used for lawful purposes such as archiving, accessibility, transcription and research. A few things worth knowing before you point it somewhere:
- "Public" is not "public domain." A stream being freely viewable does not make it freely reusable; some sites license their audiovisual output under separate terms. Check the site's reuse terms.
- DRM-free is not the same as unprotected in law. In some jurisdictions, circumventing even a lightweight token or signature scheme can raise anti-circumvention questions (US DMCA §1201). zahori stays on the safe side by refusing DRM and never defeating access gates. Keep it that way.
- In the EU, text-and-data-mining exceptions (DSM Directive Arts. 3 and 4) allow reproduction of lawfully accessible works unless the rightsholder has opted out in a machine-readable way. Respect opt-outs.
You are responsible for complying with the terms of service, copyright, and local law of the sites you use it on. When in doubt, prefer content that is explicitly open, and ask the institution.
API
Full TypeScript types ship with the package.
Documentation
Full guides live in docs/:
- CLI: every command and flag
- Library API: exported functions and types
- Profiles: the JSON format for teaching zahori a site
- MCP: using zahori from a coding agent
- Recipes: end-to-end examples
Contributing
Issues and PRs are welcome. See CONTRIBUTING.md for the dev setup, test suites and release process.
License
MIT © Jose Sepulveda
來源:README.md,提交 8769216
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分