Skip to main content

A tool for downloading music with embedded metadata and lyrics.

Project description

Here's the updated README.md with samples for downloading using a YouTube URL, along with a note recommending using the song name for better metadata matching:


Music Downloader 🎶

Music Downloader is a Python tool that downloads music from YouTube and automatically embeds metadata, album artwork, and lyrics from Genius. Perfect for building your offline music library with well-organized tags and rich media.

Features

  • Downloads audio from YouTube as MP3
  • Embeds metadata like title, artist, album, and release date
  • Fetches album artwork and attaches it to the MP3
  • Adds lyrics automatically from Genius
  • Works with most Python environments and media players

Installation

You can install Music Downloader via the qa-download package from PyPI:

pip install qa-download

Requirements

  • Python 3.7 or higher
  • YouTube audio extraction and metadata libraries (automatically installed with the package)

Usage

Once installed, use music-downloader directly from the command line.

Recommended: Using the song title (instead of a YouTube URL) gives more accurate metadata from Genius.

Downloading by Song Name

Using a song title helps Music Downloader find better metadata, artwork, and lyrics from Genius:

music-downloader "Song Title"

By default, files are saved in your Music directory, but you can specify a custom directory with the --output_dir option:

music-downloader "Song Title" --output_dir "/path/to/save/music"

Downloading by YouTube URL

If you have a specific YouTube URL, you can still use it with the downloader. However, it may miss some metadata, so using the song title is recommended for a richer media experience.

music-downloader "https://www.youtube.com/watch?v=EXAMPLE_VIDEO_ID"

For YouTube playlists, simply provide the playlist URL:

music-downloader "https://www.youtube.com/playlist?list=EXAMPLE_PLAYLIST_ID"

In both cases, Music Downloader will download each video in the playlist and try to match metadata from Genius for each song.

Example Commands

# Recommended method for best metadata
music-downloader "Let Me Down Slowly Alec Benjamin"

# Using a single YouTube video URL
music-downloader "https://www.youtube.com/watch?v=EXAMPLE_VIDEO_ID"

# Using a YouTube playlist URL
music-downloader "https://www.youtube.com/playlist?list=EXAMPLE_PLAYLIST_ID"

Command-Line Options

  • input: The YouTube URL, playlist URL, or song title you want to download.
  • --output_dir: Custom directory to save the downloaded audio. Defaults to ~/Music.

Development

If you'd like to contribute or experiment with the code, fork and clone the repository and install dependencies:

git clone https://github.com/yourusername/music_downloader.git
cd music_downloader
pip install -r requirements.txt

Running Locally

To run the downloader locally:

python -m music_downloader/downloader.py "Song Title"

Contribution

We welcome contributions to improve Music Downloader! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes, and ensure all code is properly documented and tested.
  4. Submit a pull request with a detailed explanation of your changes.

Please make sure your contributions align with the project’s code style and conventions. Feel free to open an issue if you'd like to discuss your contribution before starting.

License

This project is licensed under the MIT License.

Acknowledgments

  • Uses yt-dlp for downloading YouTube audio.
  • Metadata and lyrics from Genius.

Support

For issues or feature requests, please open an issue on GitHub.

Project details


Download files

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

Source Distribution

qa_download-1.0.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

qa_download-1.0.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file qa_download-1.0.2.tar.gz.

File metadata

  • Download URL: qa_download-1.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for qa_download-1.0.2.tar.gz
Algorithm Hash digest
SHA256 28a235ea21c9e7dde39969e5eec1b3ed41c4b37c3c050c82bf9458ebf49fa4ef
MD5 d0b79933cc46293b17f7480d745cc09a
BLAKE2b-256 9ccb7e1cfa4a2c11f3fdbf0ad92445ab0bc74b881b1c4b2ea06ea51953eb4614

See more details on using hashes here.

File details

Details for the file qa_download-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: qa_download-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for qa_download-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb2bdc7cfb7796db87b0c9cebfb304b92bfe139eba5bd34b11e9a65397ff0eb4
MD5 37a4ebec444abd53d4bdc236e79ee9ab
BLAKE2b-256 cb5a97499d1589476953567d8dc22eed82868adf4bcf128b3721ba6fbb696d4c

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