Skip to main content

yt-audio-cli

CI codecov PyPI Python License

A simple command-line tool for downloading audio from YouTube and other sites.

What This Is

yt-audio-cli is an opinionated wrapper around yt-dlp and FFmpeg, designed specifically for audio downloads. It provides sensible defaults and a streamlined interface for common audio extraction tasks.

  • yt-dlp handles all video/audio downloading and site support (1000+ sites)
  • FFmpeg handles audio conversion and processing
  • yt-audio-cli ties them together with audio-focused defaults and a simplified CLI

If you need advanced features like video downloads, custom format selection, or fine-grained control, use yt-dlp directly.

Quick Start

# Install
pip install yt-audio-cli

# Download audio
yt-audio-cli https://youtube.com/watch?v=VIDEO_ID

Requirements

FFmpeg must be installed on your system for audio conversion:

  • Windows: winget install FFmpeg or download from ffmpeg.org
  • macOS: brew install ffmpeg
  • Linux: sudo apt install ffmpeg (Debian/Ubuntu) or sudo dnf install ffmpeg (Fedora)

yt-dlp is installed automatically as a Python dependency.

Installation

pip install yt-audio-cli

Or with uv:

uv tool install yt-audio-cli

Usage

Download Audio

# Single video (saves as MP3 by default)
yt-audio-cli https://youtube.com/watch?v=VIDEO_ID

# Multiple videos (downloaded in parallel)
yt-audio-cli URL1 URL2 URL3

# Entire playlist
yt-audio-cli https://youtube.com/playlist?list=PLAYLIST_ID

# From a batch file (one URL per line)
yt-audio-cli --batch urls.txt

Choose Format

yt-audio-cli -f opus URL   # Opus (smallest size)
yt-audio-cli -f aac URL    # AAC
yt-audio-cli -f mp3 URL    # MP3 (default)
yt-audio-cli -f wav URL    # WAV (lossless)

Choose Quality

yt-audio-cli -q best URL    # Highest quality (default)
yt-audio-cli -q good URL    # Balanced
yt-audio-cli -q small URL   # Smallest file size

# Or set exact bitrate (32-320 kbps)
yt-audio-cli -b 256 URL

Save Location

# Save to specific folder
yt-audio-cli -o ~/Music URL

# Default: current directory

Skip Metadata

# Don't embed title/artist in the file
yt-audio-cli --no-metadata URL

Parallel Downloads

# Use 8 concurrent workers (default: 4)
yt-audio-cli -w 8 URL1 URL2 URL3

# Single-threaded download
yt-audio-cli -w 1 URL

Batch File

# Download from a file containing URLs (one per line)
yt-audio-cli --batch urls.txt

# Combine batch file with additional URLs
yt-audio-cli --batch urls.txt https://youtube.com/watch?v=EXTRA

Batch file format:

# Comments start with #
https://youtube.com/watch?v=VIDEO1
https://youtube.com/watch?v=VIDEO2

# Blank lines are ignored
https://youtube.com/watch?v=VIDEO3

Retry Failed Downloads

# Retry failed downloads up to 5 times (default: 3)
yt-audio-cli -r 5 URL

# Disable retries
yt-audio-cli -r 0 URL

Options

Option Short Description Default
--format -f Audio format (mp3, aac, opus, wav) mp3
--output -o Output directory Current dir
--quality -q Quality preset (best, good, small) best
--bitrate Exact bitrate in kbps (32-320) -
--workers -w Concurrent download workers (1-16) 4
--retries -r Retry attempts for failures (0-10) 3
--batch -b Path to file containing URLs -
--no-metadata Skip embedding metadata -
--force -F Re-download even if file exists -
--version -v Show version -
--help Show help -

Note: By default, files that already exist in the output directory are skipped. Use --force to re-download them.

Troubleshooting

"FFmpeg not found" Install FFmpeg using the instructions in Requirements.

"Video unavailable" The video may be private, age-restricted, or region-locked. This is a limitation of the source site, not yt-dlp or this tool.

"Signature solving failed" / JS challenge warnings YouTube uses JavaScript challenges to protect some video formats. You may see warnings like:

yt-dlp: [youtube] Signature solving failed: Some formats may be missing.

Downloads usually still work (yt-dlp falls back to alternative formats), but to resolve these warnings:

  • Install Deno (recommended): curl -fsSL https://deno.land/install.sh | sh
  • Or download the solver: yt-dlp --remote-components ejs:github

See yt-dlp EJS wiki for more details.

Download fails Check your internet connection and verify the URL is correct. If the issue persists, ensure yt-dlp is up to date: pip install -U yt-dlp

Metadata

__metadata__ = {
    "name": "yt-audio-cli",
    "version": "0.2.2",
    "author": "pyyupsk",
    "license": "MIT",
    "python": ">=3.12",
    "repository": "github.com/pyyupsk/yt-audio-cli",
}

Disclaimer

[!IMPORTANT] This tool is intended for downloading content you have the right to access. Respect copyright laws and the terms of service of the platforms you use.

[!CAUTION] The authors are not responsible for any misuse of this software.

License

This project is licensed under the MIT License.

Release files for yt-audio-cli 0.2.2

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 0.2.2
File Size Uploaded
yt_audio_cli-0.2.2.tar.gz 27.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yt-audio-cli 0.2.2
File Interpreter ABI Platform
yt_audio_cli-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 60.9 kB

Release files / yt_audio_cli-0.2.2.tar.gz

Download URL yt_audio_cli-0.2.2.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c9f58dc1fbf646f65d34c2fe5c2740665ba90f4da7e6ba2503ecbbab718ccc20
BLAKE2b-256 checksum
How to use checksums
6b940a3283430e3fb42d9e7ebd2cfbb73ce910740aefeb0d8e9b6b8001405c21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 14, 2026.

Transparency log

Release files / yt_audio_cli-0.2.2-py3-none-any.whl

Download URL yt_audio_cli-0.2.2-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92119caea2b2d294c1f4abc6d13fbbfb6d6b1ac750d57c5a60779a66e1c346f4
BLAKE2b-256 checksum
How to use checksums
6ac64afdabe10d48323698e2e8d2d2309bd141ab6dd04a30ddace48c2b932975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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