Skip to main content

yt-audio-cli

PyPI version NPM version Crates.io version CI License

Save audio from YouTube as Opus, AAC, MP3 or WAV, with no yt-dlp or FFmpeg.

📝 Changelog · 🐛 Issues

yt-audio-cli saves a 6-video playlist as MP3

Features

  • 📦 One binary. It needs no Python, yt-dlp or FFmpeg
  • ⚡ Starts in about 1 ms and uses about 10 MB of memory
  • 🎧 Opus and AAC come straight from YouTube, with no second encode
  • 📃 Videos, playlists and a batch file of URLs, with parallel downloads
  • 🔁 A dropped connection resumes from the last byte
  • 🏷️ Writes the title and channel as tags in Opus and MP3 files
  • 🧹 Ctrl-C deletes the files that did not finish
  • 🎨 Shows a progress bar for each download and a summary line at the end
  • 🌍 Linux, macOS and Windows, on x86_64 and arm64

Install

On macOS or Linux, open Terminal and paste:

curl -fsSL https://fasu.dev/yt-audio-cli.sh | sh

On Windows, open PowerShell and paste:

irm https://fasu.dev/yt-audio-cli.ps1 | iex

The script checks the download against the release SHA256SUMS and installs the program for your user only, with no admin rights. It puts the program in ~/.local/bin (on Windows, %LOCALAPPDATA%\Programs\yt-audio-cli) and adds that folder to your PATH. When it finishes, open a new terminal.

If you already use one of these tools, you can install with it instead:

uv tool install yt-audio-cli          # or: pipx install yt-audio-cli
npm install -g @pyyupsk/yt-audio-cli  # or: pnpm add -g, bun add -g
cargo binstall yt-audio-cli           # or: cargo install yt-audio-cli (needs a C compiler)

All of them install the same binary. To run it once, use uvx yt-audio-cli, npx @pyyupsk/yt-audio-cli or bunx @pyyupsk/yt-audio-cli.

Each release also has an archive for every system, with a SHA256SUMS file.

Usage

yt-audio-cli https://youtu.be/E-TVrIwwmpc

The file goes into the current folder, named after the video title.

If you run yt-audio-cli with nothing after it, or double-click it on Windows, it asks you to paste a URL. It then saves the file to your Downloads folder.

Progress, notes and errors go to stderr. If stdout is not a terminal, it gets only the path of each saved file, one per line, so a script can read them. To turn off colors, set NO_COLOR=1.

# Several videos, or a whole playlist
yt-audio-cli URL1 URL2
yt-audio-cli "https://www.youtube.com/playlist?list=PLAYLIST_ID"

# URLs from a file, one per line. Lines that start with # are skipped
yt-audio-cli --batch urls.txt

# Another format and folder
yt-audio-cli -f mp3 -o ~/Music URL

CLI

Option Does
-f, --format <FORMAT> opus (default), aac, mp3 or wav
-o, --output <DIR> Folder for saved files. Default: the current folder
-b, --batch <FILE> Reads URLs from a text file, one per line
-F, --force If the file exists, replaces it
-q, --quality <PRESET> MP3 only: best (320 kbps, default), good (192), small (128)
--bitrate <KBPS> MP3 only: 32 to 320 kbps. Overrides --quality
--no-metadata Writes no title and artist tags
-w, --workers <N> Parallel downloads, 1 to 16. Default: 4
-r, --retries <N> Retries per failed download, 0 to 10. Default: 3
-V, --version Prints the version

Some older videos have no Opus stream. For these, yt-audio-cli uses the AAC stream. If you asked for opus, it encodes the AAC to Opus at 128 kbps and prints a note. AAC and WAV files have no place for tags.

Exit code Means
0 All files were saved or were already there
1 At least one URL failed
2 No URLs were given, or yt-audio-cli cannot read the batch file
130 Stopped with Ctrl-C. Press it twice to quit at once

Moving from 0.2.x

Version 1.0 is a rewrite in Rust that supports YouTube only.

  • The default format is now opus, not mp3. Use -f mp3 to keep the old result
  • -q and --bitrate now apply to MP3 only. Opus and AAC keep the quality of the YouTube stream
  • Print the version with -V. The old -v is gone
  • File names, --batch, -o, -F, -w, -r and --no-metadata work as before

The last Python version is v0.2.4.

Why?

yt-dlp supports more than 1,000 sites and needs Python and FFmpeg for audio. yt-audio-cli does one job: it saves YouTube audio. It asks YouTube for the streams the way the YouTube app for Apple Vision Pro does, so it does not need a JavaScript runtime. Opus and AAC files are copied as they are, not encoded again.

YouTube changes its systems often. If downloads stop working, update to the latest version. If that does not help, open an issue.

License

MIT License © 2026 Pongsakorn Thipayanate

The binary includes LAME for MP3, under the LGPL. The full source is in this repository, so you can build the binary with your own copy of LAME.

Metadata

Release files for yt-audio-cli 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yt-audio-cli 1.0.1
File Size Uploaded Provenance Actions
yt_audio_cli-1.0.1.tar.gz 325.1 kB With provenance Details for yt_audio_cli-1.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for yt-audio-cli 1.0.1
File Actions
yt_audio_cli-1.0.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for yt_audio_cli-1.0.1-py3-none-win_amd64.whl
yt_audio_cli-1.0.1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for yt_audio_cli-1.0.1-py3-none-musllinux_1_2_x86_64.whl
yt_audio_cli-1.0.1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for yt_audio_cli-1.0.1-py3-none-musllinux_1_2_aarch64.whl
yt_audio_cli-1.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for yt_audio_cli-1.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
yt_audio_cli-1.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for yt_audio_cli-1.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
yt_audio_cli-1.0.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for yt_audio_cli-1.0.1-py3-none-macosx_11_0_arm64.whl
yt_audio_cli-1.0.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for yt_audio_cli-1.0.1-py3-none-macosx_10_12_x86_64.whl

Total release size: 19.9 MB

Release files / yt_audio_cli-1.0.1.tar.gz

Download URL yt_audio_cli-1.0.1.tar.gz
Size 325.1 kB
Tags Source
SHA-256 checksum
How to use checksums
def395ba561d0ec74b41462963dec30c233a7c8a79224dc0f3deea092908442b
BLAKE2b-256 checksum
How to use checksums
cca16f4ca81ae7d1b9b7f7abcd9e28f5c2b8084d0526b9303b3ecd7fbbaab01e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-win_amd64.whl

Download URL yt_audio_cli-1.0.1-py3-none-win_amd64.whl
Size 2.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
026d064704c5da0bae75e7b72e77f12ee5dc17fe6dcd17b0e9ed6ae9ec5ca4fe
BLAKE2b-256 checksum
How to use checksums
c181ec2da9913c00f2ea412e50dd29df719656c9ef8988159358c48dba6424c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-musllinux_1_2_x86_64.whl

Download URL yt_audio_cli-1.0.1-py3-none-musllinux_1_2_x86_64.whl
Size 3.0 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
41de65697d61aab07a31a4b451aa396f827611ce6f168130ae2feae024c637db
BLAKE2b-256 checksum
How to use checksums
4f07164378f11aea91c5f5c5db5b4dabfe352acc3d68b003adcabdbd6147bec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-musllinux_1_2_aarch64.whl

Download URL yt_audio_cli-1.0.1-py3-none-musllinux_1_2_aarch64.whl
Size 2.7 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0431b5170ada2975fc95db5bdae7c16d3dad910e286fea7e9cdaa1c840f52e6a
BLAKE2b-256 checksum
How to use checksums
cc3d1138654338c2d9209210277cfde3d73d21fcf4524d07f6988962bc9356be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL yt_audio_cli-1.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.9 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
678c5a4a01d7e28bc0be992731854d3419a1747c6252fb537b7e83c9a214567e
BLAKE2b-256 checksum
How to use checksums
990d87a18e6e3b9be8f3b2c7902159a2c1ae5b7d7181455cd2e4c97fab9d4b5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL yt_audio_cli-1.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e107f73a31e0d97c91c2a7df7ab1834cf8c710645b5125c1c78f4dbf8e81d727
BLAKE2b-256 checksum
How to use checksums
53a867ffebe37aad42986aa92b069547f232b70663a42a71420531663514edc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-macosx_11_0_arm64.whl

Download URL yt_audio_cli-1.0.1-py3-none-macosx_11_0_arm64.whl
Size 2.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
317ef36c4185d4758dd8ce602ae89567d664471b688a59c7fb868a9de41e6317
BLAKE2b-256 checksum
How to use checksums
584486fa195fc5d48befacbce4df58423453f5541ced06fd5e1dd97925c67ffb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / yt_audio_cli-1.0.1-py3-none-macosx_10_12_x86_64.whl

Download URL yt_audio_cli-1.0.1-py3-none-macosx_10_12_x86_64.whl
Size 2.8 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
559c39054a34f153fc5c565430eef7c6889d1c3e7a98e6d52e6daa499c431d49
BLAKE2b-256 checksum
How to use checksums
15d146e613ee6c37166e88df7f34208867154f641f21408777a466ecc58ed267
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for yt-audio-cli 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for yt_audio_cli-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page