A powerful CLI tool for downloading high-quality music from Tidal, Qobuz, and more via Lucida.to.
No credentials required! Uses Playwright to automate downloads through the web interface.
- π΅ Album Downloads: Batch download entire albums with parallel workers
- π Auto-Retry: Automatically retries failed tracks until all succeed
- βοΈ Skip/Resume: Detects existing files, skips already downloaded tracks
- π Manifest Tracking:
.lucida_manifest.jsontracks all downloaded files - πΎ Integrity Verification: Uses ffprobe to verify downloaded files aren't corrupted
- π¦ ZIP Creation: Package albums into ZIP archives
- πΏ Multi-Disc Support: Handles multi-disc albums with
--discs Nflag - π’ Track Sorting: Sort files by album order with
--sortcommand - π¨ Track Prefixes: Add disc/track prefixes (e.g.,
1-01 - Artist - Track.flac) - π·οΈ Metadata Embedding: Embed track numbers in audio files via ffmpeg
- βοΈ Configurable: Parallel workers, retry count, pause duration all adjustable
- Python 3.8 or higher
- pip (Python package manager)
- Install dependencies:
pip install -r requirements.txt- Install Playwright browsers (required for downloads):
playwright install chromium- Try the CLI:
# Search uses Amazon Music by default
python cli.py search "hotel california"
python cli.py search "daft punk" --limit 5
# List available services
python cli.py services- Start the API:
python api_server.py
# Visit http://localhost:8000/docs for interactive API documentation# Search Amazon Music (default)
python cli.py search "hotel california"
python cli.py search "shape of you" --limit 5
# Search other services
python cli.py search "daft punk get lucky" --service tidal
python cli.py search "album name" -s qobuzpython cli.py download "https://tidal.com/browse/track/123456"
python cli.py download "https://open.qobuz.com/track/123456" -o ./my-music/song.flacpython cli.py info "https://tidal.com/browse/track/123456"python cli.py servicespython api_server.pyAPI docs: http://localhost:8000/docs
Search:
curl -X POST http://localhost:8000/search \
-H "Content-Type: application/json" \
-d '{"query": "daft punk", "service": "tidal", "limit": 5}'Download:
curl -X POST http://localhost:8000/download-file \
-H "Content-Type: application/json" \
-d '{"url": "https://tidal.com/browse/track/123456"}' \
--output track.flacSee full documentation in DOCUMENTATION.md
lucida_flow/
βββ lucida_client.py # Core web scraping client
βββ cli.py # CLI application
βββ api_server.py # FastAPI server
βββ requirements.txt # Dependencies
βββ .env # Configuration (optional)
βββ downloads/ # Default download directory
Create .env file:
DOWNLOAD_DIR=./downloads
API_HOST=0.0.0.0
API_PORT=8000
LUCIDA_BASE_URL=https://lucida.to
REQUEST_TIMEOUT=30This tool uses browser automation (Playwright) to interact with Lucida.to's web interface for downloads, and web scraping for search. No service credentials required!
Technical Details:
- Search: Uses HTTP requests + BeautifulSoup to parse Lucida.to search results
- Downloads: Uses Playwright to automate a headless Chrome browser that clicks the download button on Lucida.to
- Rate Limiting: Enterprise-grade sliding window algorithm (30 req/min, 500 req/hour, 2s min delay)
For educational and personal use only. Respect copyright laws and terms of service.
MIT License
# Download an album (simplest)
meloflow download https://tidal.com/album/123456
# Download to a specific folder
meloflow download https://tidal.com/album/123456 -o ~/Music
# Download with faster speed (4 tracks at once)
meloflow download https://tidal.com/album/123456 -p 4
# Multi-disc album (e.g., 2 CDs)
meloflow download https://tidal.com/album/123456 --discs 2
# Download with extra options
meloflow download URL --zip --embed-metadata --verify# Sort tracks in album order
meloflow sort "~/Music/Album Name"
# Sort with track numbers in filenames
meloflow sort "~/Music/Album Name" --prefix
# Result: "01 - Artist - Song.flac", "02 - Artist - Song.flac"
# Multi-disc: "1-01 - Song.flac", "2-01 - Song.flac"# Check all albums for corrupted files
meloflow verify
# Check specific folder
meloflow verify -o ~/Music
# Fix track order if downloaded wrong
meloflow fix-order https://tidal.com/album/123456
# Fix multi-disc album
meloflow fix-order https://tidal.com/album/123456 --discs 2meloflow history # See what you've downloaded
meloflow services # List supported streaming services
meloflow config # Show current settings
meloflow --help # Full help with all options| Option | What it does |
|---|---|
-o folder |
Save to folder |
-p 4 |
Download 4 tracks at once |
-r 5 |
Retry failed tracks 5 times |
--zip |
Make ZIP file after download |
--verify |
Check for corrupted files |
--no-auto-retry |
Don't keep retrying automatically |
--pause 30 |
Wait 30 seconds between retries |
Lucida Flow remembers what you've downloaded. Run the same album URL again and it will skip tracks you already have, download only missing tracks, and check for corrupted files.
Tracks are tracked in .lucida_manifest.json inside each album folder:
{
"_meta": {
"url": "https://tidal.com/album/...",
"name": "Album Name"
},
"https://tidal.com/track/123456": {
"filename": "Artist - Track Name.flac",
"size": 23000000,
"track": 1,
"disc": 1
}
}meloflow/
βββ lucida_simple.py # Core download logic (~1300 lines)
β βββ DownloadResult # Result object with counts
β βββ lucida_download() # Single track download
β βββ lucida_download_album() # Album with parallel workers
β βββ parse_album_for_tracks() # Extract from lucida.to
β βββ verify_file() # ffprobe integrity check
β βββ sort_album_tracks() # Sort by manifest order
β βββ fix_album_track_order() # Re-fetch order
βββ cli.py # Click CLI (~280 lines)
βββ README.md # This file
βββ backups/ # Previous versions
- Track names - lucida.to shows "Track 1", "Track 2" until download
- No disc info - Use
--discs Nfor multi-disc albums - No lyrics - lucida.to doesn't support; lyrics.ovh has limited coverage