Ytstr is an advanced, terminal-first YouTube audio streamer equipped with an intelligent, automated DJ transition engine. It performs real-time spectral-energy analysis on track handoffs to dynamically apply custom DJ transitions (crossfades, filter sweeps, bass-line swaps, reverb melts, and turntable tape-stops) — delivering a gapless, radio-like listening experience within a microscopic system footprint.
Ytstr bridges stream ingestion and playback by running offline DSP transformations on overlapping track boundaries:
[ YouTube Search / Query ] ──► (yt-dlp URL Ingestion)
│
▼
[ High-Speed Temp Cache ] ──► (ffmpeg Chunk Demuxing)
│
▼
[ Spectral-Energy Engine ] ──► (RMS, Bass, Treble, Variance Analysis)
│
▼
[ DJ Decision Engine ] ──► (Selects Best Transition Rule)
│
▼
[ pydub DSP Transition Mixer ] ──► (Renders Crossfade/Warp/Filter)
│
▼
[ mpv Playback Engine ] ──► (IPC Unix Socket Control Loop)
- Intelligent Handoff Analysis: Extracts audio characteristics (signal RMS, kick-drum sub-250 Hz energy, treble above 2 kHz, and amplitude variance) from the ending and starting 5-second track windows to determine the optimal transition.
- Premium DSP Transition Palette:
- Bass Swap: Sweeps a high-pass filter exponentially on the outgoing track while enforcing a "full kill" sub-120 Hz HP on the incoming track to prevent muddy low-end collisions.
- Filter Wash: Sweeps high-pass cutoffs up to 2 kHz, blending a progress resonance bandpass to mask clashing harmonic keys.
- Melt: Multi-tap echo delay lines attenuated over an extended 4-second decay window, dissolved using a 3 kHz low-pass filter.
- Tape Stop / Start: Adjusts raw audio frame rates progressively to simulate vinyl turntables grinding to a halt or spinning up.
- Dynamic Rise: Sinusoidal equal-power crossfade paired with an active +4 dB gain swell on the incoming drop.
- Low-Resource IPC Orchestration: Controls
mpvvia Unix sockets, consuming a microscopic fraction of the RAM used by browser-based players. - Full Interactive TTY Controls: Pause, skip, seek, and toggle volume in the terminal. Includes hardware media-key hook options via
pynput.
Aligned with the sovereign ANTIGRAVITY Protocol, Ytstr is optimized for high-bandwidth execution:
- Zero Heavy ML: All audio characteristics are calculated using raw RMS and math-based frequency estimators inside
pydub, completely avoiding heavy local ML frameworks. - System Offloading: Offloads rendering and playback processes to standard system packages (
mpv,ffmpeg), ensuring smooth execution on dual-core setups (Mac Air 2017 i5, 8GB RAM).
Install the core media decoders:
sudo apt install mpv ffmpegpip install yt-dlp pydub pynputStart streaming a direct URL or keyword query:
# Stream by search query (Auto-mix mode)
./ytstr "cyberpunk synthwave mix"
# Stream with sequential playback (No-mix low-compute mode)
./ytstr "lofi hip hop radio" --no-mixThis project is licensed under the GPL-3.0 License. See the LICENSE file for details.
Because this repository contains personal code, portfolios, or intellectual property, strict privacy protections are in place.
This repository is published for direct human viewing only. Automated data scraping, harvesting, and crawling are strictly prohibited under the author's personal copyright terms.
By accessing this repository or its contents, you agree to the following terms:
- NO AI/LLM Ingestion: Any ingestion of code, text, layouts, designs, or assets for training, validation, testing, or tuning of machine learning models, neural networks, or artificial intelligence systems (such as Large Language Models) is strictly prohibited.
- NO Automated Data Scraping: Any automated extraction, parsing, harvesting, or scraping of content by bots, crawlers, scripts, or spiders is prohibited.
- Personal Use Only: Human viewing for personal or educational review is permitted. No duplication, modification, adaptation, or commercial distribution of this work is allowed without express written permission.