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

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

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.

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.0

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.0
File Size Uploaded Provenance Actions
yt_audio_cli-1.0.0.tar.gz 324.0 kB With provenance Details for yt_audio_cli-1.0.0.tar.gz

Built distributions (wheels)

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

Total release size: 19.8 MB

Release files / yt_audio_cli-1.0.0.tar.gz

Download URL yt_audio_cli-1.0.0.tar.gz
Size 324.0 kB
Tags Source
SHA-256 checksum
How to use checksums
20316c316a7d1fe34590b5ad2d709c05beb23a64c2495036687624f5c8f50247
BLAKE2b-256 checksum
How to use checksums
e80aed029a41aa7d5282e51993fae3a9aaa66a728910e9190dfca50ccc57bb4b
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.0-py3-none-win_amd64.whl

Download URL yt_audio_cli-1.0.0-py3-none-win_amd64.whl
Size 2.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
37ac1db2242e2f0588cedad1a2bc09ded49232bf20c4ca48cec88da75e2544fc
BLAKE2b-256 checksum
How to use checksums
8141ded358ff41f2a9de0ca36e85cb81e8252d73be42a62447785ddef764b22a
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.0-py3-none-musllinux_1_2_x86_64.whl

Download URL yt_audio_cli-1.0.0-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
51f23abab16f998a7a5ac84de5988189bc1636eab40ae7de2873255f99156440
BLAKE2b-256 checksum
How to use checksums
e3309067f55de95196f30a2a14bf6e4f594c576c7f12cd7e00b414449edb221a
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.0-py3-none-musllinux_1_2_aarch64.whl

Download URL yt_audio_cli-1.0.0-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
1a9cdbbf201ca6564cd179375ed665491423169e766d1a224682f5c94a0e49a8
BLAKE2b-256 checksum
How to use checksums
d34403c4da6afdc5b2348b6b340dccab98e327b192adec837e35fabba9db5ad0
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.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL yt_audio_cli-1.0.0-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
e40b3249d00395b570ef77aa3f501c51707ccbafbb0218db0c4f55433ab4e083
BLAKE2b-256 checksum
How to use checksums
d96f5c130158b207d655c27e762eb6be5edb149dbaa58137912b5d5d8be346ab
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.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL yt_audio_cli-1.0.0-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
8949a1e5c61747c8e060d94137a00ece48500bc463ab930f090a58f09d30d069
BLAKE2b-256 checksum
How to use checksums
ffd21412dd43fa659538ad6b2de2580f8f931951f5661c8db50f9ff67e9b3151
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.0-py3-none-macosx_11_0_arm64.whl

Download URL yt_audio_cli-1.0.0-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
383c1f865c3fbbbb8860ac34f09595f76f76f27fb6dedfce3b0fbd3a0609d831
BLAKE2b-256 checksum
How to use checksums
6c860d0810432720657de7ed2aa6e5f860dd086312472905b8521111f7f13724
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.0-py3-none-macosx_10_12_x86_64.whl

Download URL yt_audio_cli-1.0.0-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
212f56e7168f0bc2bc4c3074ee0b23f3660603da345e97b04c9ed93c2d718454
BLAKE2b-256 checksum
How to use checksums
b96bf86c36d7ef73f4c5eb82796cd690bdfff3339478f38610e3f76b77115f48
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.0

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.0.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