Capture, and watch TU Vienna LectureTube livestreams straight from your terminal.
Find a file
2025-10-08 17:35:50 +02:00
nix Fix systemd service 2025-10-08 17:35:50 +02:00
src Add nixos module 2025-10-08 17:04:15 +02:00
.envrc Setup project 2025-10-06 22:17:34 +02:00
.gitignore Ignore result dir 2025-10-07 02:40:49 +02:00
build.zig Implement channels command 2025-10-06 23:40:55 +02:00
build.zig.zon Add zig-cli 2025-10-06 22:32:36 +02:00
deps.nix Add nix package 2025-10-07 14:29:44 +02:00
flake.lock Add nix package 2025-10-07 14:29:44 +02:00
flake.nix Add nixos module 2025-10-08 17:04:15 +02:00
LICENSE Initial commit 2025-10-06 22:16:12 +02:00
README.md Update README.md 2025-10-07 17:26:45 +02:00

capTUre

Capture, watch, and catalogue TU Vienna LectureTube livestreams straight from your terminal.

Features

  • Record livestreams to local files with configurable container formats and passthrough ffmpeg options.
  • Watch channels live via mpv without having to look up LectureTube URLs manually.
  • Browse a curated list of frequently used TU Vienna lecture halls and resolve short aliases to full stream URLs.
  • Ships with a spinner-based progress UI and coloured terminal output for better feedback while recording or watching.

Prerequisites

  • ffmpeg in $PATH for the record command.
  • mpv in $PATH for the watch command.

Getting Started

Build with Zig

zig build -Doptimize=ReleaseSafe

The resulting binary is placed under zig-out/bin/capTUre. You can run commands through Zig as well:

zig build run -- channels --show-urls

Build with Nix

nix build .#capTUre   # produces result/bin/capTUre
nix develop           # drops you into a shell with zig master, zls, etc.

Both commands rely on the deps.nix link farm generated from build.zig.zon and will fetch the pinned zig-cli dependency automatically. The packaged binary is wrapped so ffmpeg and mpv provided by Nix are on PATH at runtime.

Usage

List known channels

capTUre channels
capTUre channels --show-urls      # include LectureTube links
capTUre channels --show-aliases   # toggle alias display (on by default)

The channels command prints the curated set from src/university/Channel.zig. Aliases such as hs7, audimax, or the full stream slug resolve to canonical URLs.

Record a livestream

capTUre record --channel hs8
capTUre record --channel https://live-cdn-2.video.tuwien.ac.at/... --output-file lecture.ts
capTUre record --channel gm1 --format mkv --ffmpeg-opts "-t=00:30:00"
  • The channel value may be a friendly alias, the human-readable name, or a full LectureTube URL.
  • If --output-file is omitted, capTUre stores the stream as capTUre-<unix-timestamp>.ts.
  • Additional --ffmpeg-opts arguments are forwarded verbatim (flag is repeatable).

Watch a livestream

capTUre watch --channel gm2

This spawns mpv with the correct referrer header so you can monitor the stream without manual URL lookups.

Development

  • Run tests: zig build test (or nix build .#capTUre for a full package build).
  • Format code using zig fmt (Zig handles formatting on save/build).
  • Dependencies are declared in build.zig.zon; update them via zig fetch --save … followed by regenerating deps.nix (e.g. with zon2nix).

License

Licensed under the GNU Affero General Public License v3.0. See LICENSE for details.