Skip to main content

CLI tool for searching YouTube/YTMusic and downloading audio/video from 1000+ platforms

Project description

fm-dlp — Download from YouTube, YTMusic, and 1000+ sites

Python PyPI License Platform Ruff

CLI tool for searching YouTube/YTMusic and downloading audio/video from 1000+ platforms

🚀 Quick Start

pip install fm-dlp                    # Python 3.10+ & FFmpeg required
fm-dlp config ~/Music                 # Set download directory
fm-dlp search "artist"                # Search tracks
fm-dlp download "URL" --codec flac    # Download audio

🌈 Color Output

By default, fm-dlp uses colored output for better readability. To disable colors globally, use the --no-color flag before the command:

fm-dlp --no-color search "artist"
fm-dlp --no-color download "URL"
fm-dlp --no-color config ~/Music

📋 Commands

search

Search for music tracks, albums, or videos on YouTube/YTMusic.

fm-dlp search <query> [--limit LIMIT] [--yt-video] [--album] [--raw] [--only-url]
Option Default Description
query Required Search query string
--limit N, -l 10 Maximum number of results to return
--yt-video, -v False Search for YouTube videos instead of music tracks
--album, -a False Search for albums instead of individual tracks
--raw, -r False Output results in raw format (Python dict representation)
--only-url, -u False Output only the URLs without any formatting

download

Download audio or video content from supported platforms (YouTube, YTMusic, and 1000+ sites).

fm-dlp download <urls> [--codec CODEC] [--kbps KBPS] [--jobs JOBS] [--quiet] [--no-metadata] [--save] [--path PATH] [--only-video] [--cookies COOKIES]
Option Default Description
urls Required Single URL, comma/space-separated list, or path to text file with URLs (one per line, # for comments)
--codec, -c m4a (macOS)
opus (others)
Audio: mp3, aac, flac, m4a, opus, vorbis, wav, alac
Video: mp4, mov, mkv, webm, avi, flv
--kbps, -k 256 Audio bitrate in kbps (64–320). Higher = better quality, larger file
--jobs, -j 5 Maximum number of concurrent downloads for faster batch processing
--quiet, -q False Suppress yt-dlp output messages (errors still shown)
--no-metadata False Disable embedding metadata (title, artist, album) and thumbnail into audio files
--save, -s False Saving settings (except URL)
--use-config, -u False Use saved parameters from config file as defaults
--path, -p Configured path Custom download directory (overrides default config)
--only-video, -v False Download video file without audio track
--cookies, -C None Browser name: brave, chrome, chromium, edge, opera, vivaldi, whale, firefox, safari
Or path to cookies file (.txt, .sqlite, .db, .cookies)

Audio Codec Details:

  • Lossy: mp3 (universal), aac (Apple), m4a (Apple), opus (modern web) - smaller files
  • Lossless: flac (high quality), wav (uncompressed), alac (Apple lossless) - larger files
  • Recommended: opus for best quality/size ratio, flac for archival

Video Container Details:

  • mp4 - Most compatible, uses m4a audio
  • mkv - Open format, uses opus audio
  • webm - Web optimized, uses opus audio
  • mov - Apple format, uses m4a audio
  • avi - Legacy Windows, uses mp3 audio
  • flv - Flash video, uses aac audio

config

Configure the default download directory path.

fm-dlp config <path>
Option Default Description
path Required Default directory path for downloads. Use absolute path for best results (e.g., /home/user/Music or C:\Music)

Config Location:

  • Windows: %LOCALAPPDATA%/fm-dlp/config.json
  • macOS: ~/Library/Application Support/fm-dlp/config.json
  • Linux: ~/.config/fm-dlp/config.json

⚙️ Requirements

  • Python 3.10+ - Asyncio support required
  • FFmpeg - Required for audio/video processing. Install via:
    • macOS: brew install ffmpeg
    • Linux: sudo apt install ffmpeg (Debian) or sudo dnf install ffmpeg (Fedora)
    • Windows: Download from ffmpeg.org and add to PATH

Verify installation: ffmpeg --version


🔧 Validation & Error Handling

The CLI performs comprehensive validation before executing commands:

Search:

  • Validates that --limit is a positive integer

Download:

  • Validates URLs (must start with http:// or https:// or be a valid file)
  • Validates codec against supported list
  • Validates bitrate range (64–320 kbps)
  • Validates job count (must be >= 1)
  • Validates download path (must exist and be a directory)
  • Validates cookies (browser name or valid file path with correct extension)
  • Checks FFmpeg installation

Config:

  • Validates path exists and is a directory
  • Creates config directory if it doesn't exist
  • Handles permission errors gracefully

📄 License & Acknowledgments

MIT License — Built with:

Library Purpose
yt-dlp Download engine supporting 1000+ sites
ytmusicapi YouTube Music search API
mutagen Metadata tagging for audio files

Author: Fkernel653

Project: GitHubPyPI

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fm_dlp-4.4.0.4.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fm_dlp-4.4.0.4-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file fm_dlp-4.4.0.4.tar.gz.

File metadata

  • Download URL: fm_dlp-4.4.0.4.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fm_dlp-4.4.0.4.tar.gz
Algorithm Hash digest
SHA256 1a8472b8e87030c99c2935cd840c8a4a321fa750df58fd3d895f17e9050c391f
MD5 1fe398ee83e4ad7bf0c1f05ccefa59e0
BLAKE2b-256 9b2fa46103e86cac90622a6d5889b6f31910acc7b3ff99bd3e8cd19947fb36e5

See more details on using hashes here.

File details

Details for the file fm_dlp-4.4.0.4-py3-none-any.whl.

File metadata

  • Download URL: fm_dlp-4.4.0.4-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fm_dlp-4.4.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 41602d118fbbf77b9c979aa65cce2c1066728e9cc18e96a6f33e6389f01cf041
MD5 cc43e3ddd7bf9734b70640ff680dd4c3
BLAKE2b-256 a4a5bc5b762bfc9a39ed3b7d1a5d1c710d7563b631b0fc4efe2d475e0ffabc6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page