MCPcopy Index your code
hub / github.com/PrathxmOp/dab-downloader

github.com/PrathxmOp/dab-downloader @1.1.15

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.15 ↗ · + Follow
207 symbols 616 edges 37 files 139 documented · 67%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🎵 DAB Music Downloader

Build & Release Go Version License Release Discord Support

A high-performance, modular music downloader designed for audiophiles.
Effortlessly fetch high-quality FLAC audio with comprehensive metadata, embedded artwork, and smart organization from the DAB API.


📖 Table of Contents


✨ Features at a Glance

🚀 Core Experience

  • High-Fidelity Audio: Downloads pristine FLAC files directly from source.
  • Smart Metadata: Automatically tags files with Title, Artist, Album, Genre, Year, ISRC, and more via MusicBrainz.
  • Format Conversion: Built-in support for converting to MP3, OGG, or Opus on the fly.
  • Batch Downloading: Process multiple URLs or search queries from a simple text file.
  • Interactive TUI: Navigate search results and select multiple items with a modern, terminal-based user interface.
  • Configuration Editor: Manage your settings interactively without manual JSON editing.

🔗 Integrations

  • Spotify: Import and download entire playlists or albums directly.
  • ListenBrainz: Import tracks from ListenBrainz JSPF playlists.
  • Navidrome: Seamlessly sync downloaded content to your Navidrome media server.
  • MusicBrainz: Enhances metadata accuracy with advanced database lookups and caching.

📸 Screenshots

Interactive Search TUI Interactive search with multi-selection support.

Download Progress Parallel downloads with detailed progress tracking.


📋 Prerequisites

  • Go 1.24+ (if building from source)
  • FFmpeg (required for format conversion and metadata processing)
  • Network access to DAB API and optionally Spotify/Navidrome.

🚀 Installation

Option 1: One-Line Installer (Linux/macOS)

The fastest way to install or update is using our installation script:

curl -fsSL https://raw.githubusercontent.com/PrathxmOp/dab-downloader/main/install.sh | bash

Option 2: One-Line Installer (Windows PowerShell)

Run the following in PowerShell (as Administrator if you want to update PATH for all users, otherwise User PATH is used):

iwr -useb https://raw.githubusercontent.com/PrathxmOp/dab-downloader/main/install.ps1 | iex

Option 3: Pre-built Binaries

  1. Visit the Releases Page.
  2. Download the binary matching your OS and architecture (e.g., dab-downloader-linux-amd64).
  3. (Linux/macOS) Make it executable and move it to your path: bash chmod +x dab-downloader-linux-amd64 mkdir -p ~/.local/bin mv dab-downloader-linux-amd64 ~/.local/bin/dab-downloader

Option 3: Docker

docker run -it -v $(pwd)/music:/music -v $(pwd)/config:/app/config prathxm/dab-downloader search "The Weeknd"

📖 Detailed Command Guide

🌍 Global Persistent Flags

These flags can be used with any command: * --api-url string: Override the DAB API URL. * --download-location string: Directory where music will be saved. * --debug: Enable verbose debug logging. * --insecure: Skip TLS certificate verification (useful for local Navidrome setups). * --warnings string: Set warning behavior: immediate, summary (default), or silent.


🔐 Authentication

login [email] [password] Authenticates your session with the DAB API.

dab-downloader login user@example.com mypassword

logout Clears the locally stored session token.

status Checks if you are currently logged in and if the session is valid.


🎵 Download & Search Commands

search [query] Search for artists, albums, or tracks using an interactive TUI. * Smart Selection: When selecting a single track, the CLI will offer to download the entire containing album. * --type string: Type of content to search for (artist, album, track, all). Default: all. * --auto: Automatically download the first result. * --expand: Automatically download the full album for the selected track (skips interactive prompt). * --format string: Target format (flac, mp3, ogg, opus). Default: flac. * --bitrate string: Bitrate for lossy formats (e.g., 320). Default: 320.

dab-downloader search "Interstellar" --type album

artist [artist_id] Download an artist's entire discography. * --filter string: Filter by type, comma-separated (e.g., albums,eps,singles). Default: all. * --no-confirm: Skip the confirmation prompt before starting downloads. * --format/--bitrate: Conversion settings.

dab-downloader artist "12345" --filter "albums"

album [album_id] Download a specific album by its ID or shared URL. * --format/--bitrate: Conversion settings.

dab-downloader album "67890" --format mp3

playlist [playlist_id] Download a DAB playlist by its ID or shared URL. * --format/--bitrate: Conversion settings.

dab-downloader playlist "344f44f8-..."

batch [file_path] Process multiple downloads from a text file (one item per line). Supports Spotify URLs, DAB URLs, and search queries. * --expand: Automatically download the full album for any tracks found via search or URLs.

dab-downloader batch my_list.txt --expand

🔗 Integrations

spotify [url] Download music from a Spotify playlist or album URL. * --expand: Instead of downloading individual tracks, search for and download the full albums containing those tracks. * --auto: Auto-select first search result on DAB.

dab-downloader spotify "https://open.spotify.com/playlist/..." --expand

listenbrainz [url] Download tracks from a ListenBrainz playlist URL. * --auto: Automatically download the first result found on DAB. * --format/--bitrate: Conversion settings.

dab-downloader listenbrainz "https://listenbrainz.org/playlist/..."

navidrome [playlist_url] Sync a Spotify or ListenBrainz playlist to your Navidrome server. It searches for tracks on your Navidrome server, downloads missing ones from DAB, and adds them to a Navidrome playlist. * --ignore-suffix string: Ignore specific suffixes in track titles during matching (e.g., "Remastered"). * --expand: Expand playlist to full albums.

dab-downloader navidrome "https://open.spotify.com/playlist/..."
# OR
dab-downloader navidrome "https://listenbrainz.org/playlist/..."

add-to-playlist [playlist_id] [song_id...] Directly add one or more track IDs to a Navidrome playlist.


🛠️ Debugging & Utilities

debug api-availability Test basic connectivity to the DAB API.

debug artist-endpoints [artist_id] Test various API endpoint formats for a specific artist ID.

debug comprehensive-artist-debug [artist_id] Run a full diagnostic suite for a specific artist ID.

config Open the interactive Configuration Editor to manage your settings.

version Print the current version of dab-downloader.


⚙️ Configuration

dab-downloader uses a config.json file to store your preferences. You can edit this file manually or use the interactive editor:

dab-downloader config

📂 Configuration Locations

The application looks for configuration in the following order: 1. Portable Mode: A config/ directory next to the binary. 2. Standard Location: * Linux/macOS: ~/.config/dab-downloader/config.json * Windows: %AppData%\dab-downloader\config.json 3. Docker: /config/config.json (inside the container).

🛡️ Key Settings

  • Parallelism: Number of simultaneous downloads (default: 5).
  • Verify Downloads: When enabled, the application verifies the integrity of each download by comparing the file size on disk with the expected size from the API. Corrupted or partial files are automatically deleted to keep your library clean.
  • Format/Bitrate: Default settings for audio conversion.

📝 Sample Configuration

{
  "APIURL": "https://dabmusic.xyz",
  "DownloadLocation": "/home/user/Music",
  "Parallelism": 5,
  "Format": "flac", 
  "Bitrate": "320",
  "SpotifyClientID": "...",
  "SpotifyClientSecret": "...",
  "NavidromeURL": "...",
  "NavidromeUsername": "...",
  "NavidromePassword": "...",
  "naming": {
    "album_folder_mask": "{artist}/{album}",
    "file_mask": "{track_number} - {title}"
  }
}

🛠️ Development

This project follows a modular structure: - cmd/dab-downloader/: CLI entry point. - internal/: Core business logic (api, downloader, ffmpeg, models, ui, utils). - pkg/: Reusable integration packages (spotify, navidrome, musicbrainz).

🧪 Running Tests

go test ./internal/...

⚖️ Legal Disclaimer

For Educational Purposes Only. Users are strictly responsible for complying with local copyright laws and respecting terms of service of third-party platforms.


Made with ❤️ by PrathxmOp and contributors

Extension points exported contracts — how you extend this code

Searcher (Interface)
Searcher interface to break import cycle [2 implementers]
internal/ui/search.go

Core symbols most depended-on inside this repo

addField
called by 35
internal/ffmpeg/metadata.go
initConfigAPIAndDownloader
called by 18
cmd/dab-downloader/main.go
GetUserInput
called by 15
internal/utils/utils.go
SanitizeFileName
called by 13
internal/utils/utils.go
Request
called by 13
internal/api/api.go
FileExists
called by 11
internal/utils/utils.go
Error
called by 11
internal/utils/retry.go
IDToString
called by 9
internal/utils/utils.go

Shape

Function 81
Method 81
Struct 43
Interface 1
TypeAlias 1

Languages

Go100%

Modules by API surface

internal/ffmpeg/metadata.go22 symbols
internal/utils/warning_collector.go19 symbols
pkg/musicbrainz/musicbrainz.go17 symbols
internal/models/models.go17 symbols
internal/utils/utils.go14 symbols
internal/api/api.go14 symbols
internal/ui/search.go11 symbols
pkg/navidrome/navidrome.go9 symbols
internal/ui/config_menu.go8 symbols
internal/downloader/downloader.go7 symbols
internal/utils/retry.go6 symbols
internal/config/config.go6 symbols

For agents

$ claude mcp add dab-downloader \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page