maybecode

CLI tool

ytwav

A command line tool that turns a source into a cleanly named lossless WAV file by orchestrating yt-dlp and ffmpeg properly.

Year
2026
Status
completed
Stack
Java 21 · ProcessBuilder · ffmpeg · yt-dlp

A small command line tool that produces one cleanly named WAV file from a source. No downloader of its own, no decoder of its own — instead two proven programs, chained together correctly.

ytwav --out ./music --normalize <url>

Why it exists

The alternatives were either web interfaces of questionable origin or hand-written shell one-liners reassembled from memory on every use. ytwav turns that into a single command with sensible defaults and error messages that say what to do next.

How it works

The interesting part is process control. Two external programs, each with its own output format, its own progress channel and its own failure modes:

  • Both processes are started through ProcessBuilder, and their output streams are read concurrently — otherwise the pipe buffer deadlocks on longer runs
  • Progress lines are parsed and merged into a single progress display
  • Cancelling cleans up child processes and half-written files reliably
  • If a tool is missing from PATH, the program says which one at startup, and how to install it

An optional metadata lookup fills in title, artist and album. Worth stressing that only metadata is queried there — the audio itself always comes from the source that was passed in.

Status

Functionally complete. It does exactly one thing and does it reliably, and nothing about that needs to change.