Documentation
¶
Overview ¶
Package source turns a user-supplied URL (YouTube Live or direct HLS) into a stream of packed RGB24 frames, sized for the half-block terminal renderer in internal/ascii. It is the URL counterpart to internal/calls, which ingests LiveKit tracks: same RGB24 frame contract, different front end.
A YouTube URL is resolved to a playable stream with `yt-dlp -g`; a direct .m3u8 is used as-is. The resolved URL is then decoded by ffmpeg into raw rgb24 frames. Every URL — the one the user typed and the one yt-dlp returns — is run through an SSRF guard (guardURL) before any connection is made.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind string
Kind classifies a source URL.
type Options ¶
type Options struct {
URL string
FPS int
PW, PH int
AllowHLS bool // permit direct .m3u8 / http(s) inputs (not just YouTube)
}
Options configures a worker. PW/PH are the pixel dimensions the decoder scales to — compute them with ascii.FitEven(cols, rows).
type Worker ¶
type Worker struct {
Frames chan []byte // each frame is PW*PH*3 bytes
Status chan string // human-readable status, best-effort (non-blocking)
Kind Kind // resolved source kind
// contains filtered or unexported fields
}
Worker is one running decode pipeline: ffmpeg reading the resolved stream and emitting RGB24 frames on Frames. Mirrors internal/calls.session so the Phase 1 fan-out multiplexer can drive either source identically.