🎵 FetchTune
Universal music metadata resolver for Python.
FetchTune is a lightweight Python library and CLI for resolving music URLs into clean, structured metadata.
It provides a unified interface for working with music data across different platforms, including tracks, artists, albums, artwork, release dates, durations, and platform information.
Supported: Spotify · Apple Music · YouTube · SoundCloud
✨ Features
| Feature | Status |
|---|---|
| Track metadata | ✅ |
| Artist metadata | ✅ |
| Album metadata | ✅ |
| Artwork & images | ✅ |
| Release date | ✅ |
| Duration | ✅ |
| Explicit status | ✅ |
| Platform IDs & URLs | ✅ |
| JSON serialization | ✅ |
| Cross-provider enrichment | ✅ |
| CLI | ✅ |
| Interactive URL input | ✅ |
| Audio download (optional extra) | ✅ |
🧱 Architecture
FetchTune uses a provider-based architecture. Each platform has its own provider responsible for resolving and normalizing platform-specific data.
FetchTune
│
Resolver
│
┌─────────────────┼─────────────────┐
│ │ │ │
SpotifyProvider AppleProvider YouTubeProvider SoundCloudProvider
│ │ │ │
└────────┴────────┼────────┴────────┘
│
Models
┌──────┼──────┐
│ │ │
Artist Album Track
The core models remain platform-independent, making it possible to add new providers without changing the rest of the library.
📦 Installation
pip install fetchtune
Optional — enable the downloader (see below):
pip install "fetchtune[downloader]"
🚀 Usage
CLI
Pass a supported music URL:
fetchtune "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
For JSON output:
fetchtune --json "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
Download a track as a tagged audio file (requires the downloader extra
and ffmpeg on your PATH):
fetchtune download "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
fetchtune download -f flac -o ~/Music "https://music.apple.com/us/album/carefree/1887648284?i=1887648293"
Python
from fetchtune import resolve
track = resolve(
"https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
)
print(track.title)
print(track.to_json(indent=2))
⬇️ Downloader (optional)
fetchtune[downloader] adds fetchtune download — turn any resolved
track URL into a tagged audio file with embedded cover art.
your URL (spotify / apple / youtube / soundcloud)
│
FetchTune ─── resolves title, artists, album,
│ duration, artwork, release date
┌─────────────┴─────────────┐
youtube/soundcloud links spotify/apple links
download the original search YouTube (fallback
│ SoundCloud), score candidates,
│ pick the best match
└─────────────┬─────────────┘
yt-dlp + ffmpeg ─── download & convert
│
mutagen ─── embed metadata + cover art
│
🎵 "Artist - Title.mp3"
pip install "fetchtune[downloader]" # + ffmpeg on your PATH
fetchtune download "https://open.spotify.com/track/..."
fetchtune download -f flac -b 320 -o ~/Music url1 url2
fetchtune download --force-search --search-source soundcloud url
Options: -o output dir · -f format (mp3 m4a flac opus ogg
wav keep) · -b bitrate · --search-source · --force-search ·
--no-cover · --no-tags · --overwrite
Python API:
from fetchtune.downloader import Downloader
dl = Downloader(output="downloads", audio_format="mp3")
path = dl.download("https://open.spotify.com/track/...")
Spotify and Apple Music expose no audio streams, so audio for those links is fetched from a streamable platform (YouTube/SoundCloud) identified via FetchTune metadata. Please use it responsibly — only for content you own or that is freely licensed, and respect platform terms of service.
🎵 Example
FetchTune resolving a real Spotify track:
Fooroodgah - HEEN's Reinterpretation
Mehrad Hidden · HEEN
Metadata
| Field | Value |
|---|---|
| Title | Fooroodgah - HEEN's Reinterpretation |
| Artists | Mehrad Hidden, HEEN |
| Platform | Spotify |
| Track ID | 4a0yULThaKQTm0hYPGEMOc |
| Release Date | 2026-08-28 |
| Duration | 3:27 |
| Duration (ms) | 207875 |
| Explicit | No |
| Album | null |
Artists
| Artist | Spotify ID |
|---|---|
| Mehrad Hidden | 0jCVTRvQkILbJvpviTpvd1 |
| HEEN | 3dt8LORgsqjLP8hAYsFKdY |
Artwork
| Size | URL |
|---|---|
| 640 × 640 | https://image-cdn-ak.spotifycdn.com/image/ab67616d0000b2739a1801fbe63582bc1b0678d9 |
| 300 × 300 | https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e029a1801fbe63582bc1b0678d9 |
| 64 × 64 | https://image-cdn-ak.spotifycdn.com/image/ab67616d000048519a1801fbe63582bc1b0678d9 |
JSON
{
"title": "Fooroodgah - HEEN's Reinterpretation",
"artists": [
{
"name": "Mehrad Hidden",
"id": "0jCVTRvQkILbJvpviTpvd1",
"url": "https://open.spotify.com/artist/0jCVTRvQkILbJvpviTpvd1"
},
{
"name": "HEEN",
"id": "3dt8LORgsqjLP8hAYsFKdY",
"url": "https://open.spotify.com/artist/3dt8LORgsqjLP8hAYsFKdY"
}
],
"album": null,
"cover_url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d0000b2739a1801fbe63582bc1b0678d9",
"images": [
{
"url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e029a1801fbe63582bc1b0678d9",
"width": 300,
"height": 300
},
{
"url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d000048519a1801fbe63582bc1b0678d9",
"width": 64,
"height": 64
},
{
"url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d0000b2739a1801fbe63582bc1b0678d9",
"width": 640,
"height": 640
}
],
"release_date": "2026-08-28T00:00:00Z",
"duration_ms": 207875,
"is_explicit": false,
"platform": "spotify",
"platform_id": "4a0yULThaKQTm0hYPGEMOc",
"url": "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
}
🔄 Album Enrichment
FetchTune can enrich incomplete track metadata using other providers.
For example:
{
"album": null
}
can potentially become:
{
"album": {
"name": "Innerlight EP",
"id": "1582831419",
"release_date": "2021-07-30T12:00:00Z",
"total_tracks": 4
}
}
This keeps the final Track model useful even when the original platform doesn't provide complete release information.
🛠️ Development
git clone https://github.com/momalekiii/fetchtune.git
cd fetchtune
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pytest
Build the package:
python -m build
Check the distribution:
python -m twine check dist/*
📄 License
MIT License
FetchTune
Music metadata, resolved.
© @momalekiii · 2026
Metadata
Release files for fetchtune 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fetchtune-0.3.3.tar.gz | 37.5 kB | Without provenance | Details for fetchtune-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fetchtune-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for fetchtune-0.3.3-py3-none-any.whl |
Total release size: 70.7 kB
Release files / fetchtune-0.3.3.tar.gz
| Download URL | fetchtune-0.3.3.tar.gz |
|---|---|
| Size | 37.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4443d85449c6fc248b9aeefbc6acf9e45317e2592f09f7522e140f7475dacad2
|
|
BLAKE2b-256 checksum How to use checksums |
0e5a6bfe6fbb6c1f5f3c368bc49a1cb6d566766d78523e010345cc83c1e50edf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / fetchtune-0.3.3-py3-none-any.whl
| Download URL | fetchtune-0.3.3-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05f91a6edb7d5c8d7993fa7fffbc94c68e466b507ecaf3663036c47a186e0b85
|
|
BLAKE2b-256 checksum How to use checksums |
9dadd23abc9ca74a7f9f84e3baa44e46dbcc9cedd6ced2bdacec9961546d0c52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for fetchtune 0.3.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.