Skip to main content

Search YouTube for music, identify songs, download as tagged MP3s

Project description

music-genie

Search YouTube for music, identify songs from mic recordings, and download them as tagged MP3s.

Invoked as mg or music-genie.

Installation

Requires Python 3.11+ and uv.

uv tool install music-genie        # from PyPI
uv tool install .                  # local dev

Recording also requires a system ffmpeg (the bundled download binary cannot access audio devices):

sudo apt install ffmpeg   # Debian/Ubuntu
brew install ffmpeg       # macOS
sudo dnf install ffmpeg   # Fedora

Usage

Search and download by query:

mg search "tame impala let it happen"

Presents up to 10 YouTube results, prompts for a selection, downloads as MP3, and embeds metadata (artist, album, year, cover art) sourced from MusicBrainz.

Identify a song from the microphone:

mg listen

Records an 8-second snippet, identifies it via Shazam, then flows into search and download. Pass --save to queue the snippet for later identification instead.

List unidentified snippets:

mg pending

Process queued snippets:

mg process

Attempts to identify each pending snippet and prompts to search and download. Unidentifiable snippets can be deleted.

Output layout

Files are saved to ~/Music/<artist>/<title>.mp3 by default.

Configuration

Settings can be overridden via environment variables or a TOML file at ~/.config/music-genie/config.toml.

Key Default Description
output_dir ~/Music Download destination
audio_format mp3 Output format (mp3, m4a, opus, โ€ฆ)
audio_quality 192 Bitrate in kbps
record_duration 8 Snippet length in seconds

Environment variables use the prefix MUSIC_GENIE_, e.g. MUSIC_GENIE_OUTPUT_DIR=/tmp/music.

Example config file:

output_dir = "/home/user/Music"
audio_format = "mp3"
audio_quality = 320
record_duration = 10

Data storage

Snippets and their metadata are stored in ~/.local/share/music-genie/snippets/ as .wav + .json pairs.

๐Ÿค– AI Disclaimer

This project uses AI-assisted development tools. See the AI usage policy for details.

Tools

  • Claude Code (Anthropic) ยท claude-sonnet-4-6 ยท Agentic

Contribution Profile

Phase                               Humanโ”‚ AI
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Requirements & Scope       85%   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ”‚โ–‘โ–‘          15%
Architecture & Design      50%      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ”‚โ–‘โ–‘โ–‘โ–‘โ–‘       50%
Implementation              5%           โ”‚โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  95%
Testing                   n/a
Documentation               5%           โ”‚โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  95%

Oversight: Autonomous

AI drives end-to-end; human reviews final output only.

Process

AI agent operated autonomously across multi-step tasks. Human reviewed diffs, resolved conflicts, and approved merges.

Accountability

The human author(s) are solely responsible for the content, accuracy, and fitness-for-purpose of this project.


Last updated: 2026-02-20 ยท Generated with ai-disclaimer

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

music_genie-0.2.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

music_genie-0.2.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file music_genie-0.2.0.tar.gz.

File metadata

  • Download URL: music_genie-0.2.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for music_genie-0.2.0.tar.gz
Algorithm Hash digest
SHA256 098b6ae1660bfead3a6f0bd5fa6ec69a3fd24f21ad0ca20a885ba70d5f5314a4
MD5 48f06ed3ff6b141200bf355b2792d085
BLAKE2b-256 476f3b54d2f171c5809eb7a2676e57b26b4a2efd420e8652355f10fa755b1d89

See more details on using hashes here.

File details

Details for the file music_genie-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for music_genie-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40fef21bb4be70d8325c41f04f1ce69ed0a04da9fed6c7509c5b7283d70a8652
MD5 6bd5f6a284c6c92b992e5866ca34f386
BLAKE2b-256 c92b2bf87f2074e908fdf4790bacc02b7b4e2acdf57274ee6a0485534f2aa43b

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