比IPTV更好且更便宜
Better and Cheaper Than IPTV

原始链接: https://github.com/stupside/castor

**Castor** 是一款命令行工具,旨在简化将网页视频流投屏至智能电视的过程,从而绕过传统屏幕镜像带来的延迟和分辨率问题。通过利用无头模式(headless)的 Chrome 提取视频流,并使用 FFmpeg 进行转码,Castor 允许你直接在任何支持 DLNA/UPnP 的设备(如三星、LG、索尼等)上播放网页内容。 **主要功能:** * **集成发现与浏览:** 使用交互式终端界面扫描设备、通过 TMDB 浏览电影,或直接按 IMDb/TMDB ID 进行搜索。 * **自动化提取:** 处理导航、iframe 以及基础的机器人防御机制(如 Cloudflare Turnstile),以获取视频链接。 * **字幕:** 支持通过 Whisper 自动生成字幕,并将其直接压制进视频流中。 * **灵活部署:** 提供原生二进制文件(通过 Homebrew 安装)或 Docker 镜像(包含 Chrome、FFmpeg 和 FFprobe)。 **快速上手:** 1. 运行 `castor scan` 以识别你的电视。 2. 配置 `config.yaml`,填入你的设备名称和 TMDB API 密钥。 3. 运行 `castor cast` 进行浏览,或运行 `castor cast player [URL]` 直接进行投屏。 *注:macOS/Windows 需要原生安装以通过主机网络实现正常的设备发现。*

最近的一场 Hacker News 讨论引起了人们对一个新 GitHub 项目的关注,该项目是一个用于流媒体播放的命令行工具。用户可以通过该软件选择电影,它能自动从各大网站定位流媒体资源,进行实时视频转码,并在投屏到电视前将字幕嵌入视频中。 讨论帖中的用户探讨了该工具绕过 Cloudflare “Turnstile” 安全验证的能力。尽管一些人对其绕过方式之简便感到惊讶,但项目作者澄清称,该工具不仅是模拟简单的鼠标点击,还通过伪造浏览器签名来规避检测。观察人士指出,该工具本质上是 IPTV 的一种替代方案,为用户提供了一种直接从流媒体平台获取并投屏内容的精简方式。
相关文章

原文

Castor

Latest Release Go Reference Homebrew License Build Status

Imagine buying a very nice TV and figuring out it doesn't allow casting from random websites...

  • Then you switch to the longest HDMI cable you can find.
  • Then you start doing screen mirroring: your computer lags, resolution tanks, nothing feels right.

Castor is a CLI that extracts video streams from websites, handles format compatibility, and casts to your TV in real time, with optional auto-generated subtitles burned directly into the video.

Browsing TMDB titles in the castor TUI
Run castor cast to browse trending titles, search TMDB, inspect posters and metadata, then cast — without leaving the terminal.

Note

How does extraction work?

Castor launches a headless Chrome with a randomized browser fingerprint and stealth scripts to hide automation. It listens to all network activity via Chrome DevTools Protocol, captures video streams, then runs an action pipeline: click the page, navigate into the largest iframe, solve Cloudflare Turnstile if detected, and click again as fallback.

This works on most streaming websites but won't beat sophisticated bot protection.

Homebrew and source build a native binary that needs Chrome/Chromium (headless extraction), ffmpeg (transcoding), and ffprobe (format detection) on your PATH. The Docker image bundles all three, so there you only supply a config.

brew install --cask stupside/tap/castor

ghcr.io/stupside/castor ships with Chrome, ffmpeg and ffprobe baked in.

# Discover devices (no config required)
docker run --rm --network host ghcr.io/stupside/castor:latest scan

# Cast, mounting config.yaml and a persistent model cache
docker run --rm --network host \
  -v "$PWD/config.yaml:/config.yaml" \
  -v castor-cache:/root/.cache \
  ghcr.io/stupside/castor:latest \
  cast player https://www.fmovies.gd/watch/movie/1315303

Important

--network host is required: device discovery is SSDP multicast and the TV streams back from Castor's replay server — neither survives Docker's bridge network. Host networking is only real on Linux; on Docker Desktop (macOS/Windows) it won't reach your TV, so run the binary natively there instead.

The castor-cache volume keeps the auto-downloaded whisper models (~75 MB) between runs. Swap :latest for :v1.0.0 to pin a release.

Needs Go 1.26+ and cmake (the whisper.cpp bindings are cgo and link a locally built libwhisper.a):

git clone --recurse-submodules https://github.com/stupside/castor.git
cd castor
make          # builds libwhisper.a, then the castor binary

go install won't work: the vendored whisper.cpp bindings come in through a local replace and need that prebuilt static lib.

Any TV implementing the DLNA/UPnP MediaRenderer:1 profile works, which covers virtually every smart TV sold in the last decade: Samsung (tested), LG, Sony Bravia, Panasonic Viera, Philips, Hisense, TCL, VIZIO, Sharp. Networked players like Kodi, VLC, and Plex also work.

Run castor scan to discover devices on your network.

Warning

Experimental: implemented but untested. Contributions welcome.

Castor requires a config.yaml in the current directory (or pass --config). Everything mechanical ships with working defaults, so the file only has to say which device to cast to, which sources to cast from, and a free TMDB API key for the browser.

# 1. Find your TV's exact name
castor scan

Create config.yaml with that name:

device:
  name: "Living Room TV"   # exact name from `castor scan`
  type: dlna

sources:
  - proxies: ["https://vidsrc-embed.ru"]
    templates:
      movie: "/embed/movie/{itemID}"
      episode: "/embed/tv/{itemID}/{season}-{episode}"

tmdb:
  api_key: "<YOUR_TMDB_API_KEY>"   # free from https://www.themoviedb.org/settings/api
# 2. Browse and cast from an interactive TUI
castor cast

castor cast first asks which device to cast to — every DLNA/UPnP renderer on your network, discovered on the fly and with your configured device pre-selected:

Selecting a cast target in the castor TUI

Then it opens a TMDB-backed browser — filter by genre, search, inspect posters and metadata, drill into a series' episodes, and cast the one you pick.

Tip

No TMDB key? You can skip the browser and cast a title straight from its id — castor cast movie tt33028778 — using the sources in your config. See Usage.

# Interactive TMDB browser: search, pick a movie/episode, cast (needs tmdb.api_key)
castor cast

# Cast from a streaming site's player page
castor cast player https://www.fmovies.gd/watch/movie/1315303

# Cast by IMDB/TMDB id, using the sources in your config
castor cast movie   tt33028778
castor cast episode tt2699128 --season 1 --episode 3

# Cast a raw stream URL directly
castor cast url https://example.com/stream.m3u8

# Useful flags
castor cast movie --dry-run tt33028778   # print found URLs without casting
castor --debug cast player https://...   # verbose logging
castor scan                              # discover devices on the network
castor info                              # version / build info

Quick start covers the required keys. Beyond those, everything mechanical (timeouts, probing, capture, transcoding, Chrome discovery) ships with working defaults. Override any of it in config.yaml, point at a different file with --config, drop secrets like your TMDB key into a git-ignored sibling config.local.yaml (it overlays config.yaml), or set CASTOR_SECTION__FIELD environment variables.

The one opt-in worth calling out is auto-generated subtitles, burned into the video:

whisper:
  enable: true             # off by default
  # language: "fr"         # default: English
  # model_path: ""         # default: ggml-tiny.en (~75 MB, auto-downloaded)

See CONTRIBUTING.md.

联系我们 contact @ memedata.com