Coverart downloader (Bluetooth and storage music)
Posted: Fri Aug 22, 2025 11:52 pm
Hello together,
another example from me
This time a coverart downloader for bluetooth and storage music.
For Apple Carplay and Android Auto this is not needed because they already deliver the coverart.
Update 2025/08/23:
- VENV bootstrap (~/.venv/hudiy) + package check and automatic install if missing
- Parallel providers: iTunes (600x600) + Deezer (500x500)
- Early-stop: as soon as a very strong match appears (EARLY_STOP_SCORE)
- Only log the chosen winner (no query spam)
- Send cover ONLY if cached / in local DB or right after download
- Inject immediately after download; save cache/DB asynchronously
- Local DB: ~/.cache/hudiy-coverart/covers_db.json (maps key -> filename + meta)
- Cache: ~/.cache/hudiy-coverart/<key>.jpg
- Offline backlog: ~/.cache/hudiy-coverart/pending/<key>.json
- Cleans metadata (cut anything after "•") if Spotify adds "video available"
- Source allowlist (MediaSource): only STORAGE and A2DP (cache/DB + downloads)
- For STORAGE requests, after sending cover, embed it into the audio file (MP3/FLAC/M4A)
- One-shot library pass at startup: find MP3 without covers, download+embed in batch
And here ist the only negative point:
- the script has to run everytime you want to have coverarts while playing music via bluetooth.
At this moment i cannot provide how to put the python script in the autostart because I haven't dealt with it yet.
Big thanks goes to ChatGPT
another example from me
For Apple Carplay and Android Auto this is not needed because they already deliver the coverart.
Update 2025/08/23:
- VENV bootstrap (~/.venv/hudiy) + package check and automatic install if missing
- Parallel providers: iTunes (600x600) + Deezer (500x500)
- Early-stop: as soon as a very strong match appears (EARLY_STOP_SCORE)
- Only log the chosen winner (no query spam)
- Send cover ONLY if cached / in local DB or right after download
- Inject immediately after download; save cache/DB asynchronously
- Local DB: ~/.cache/hudiy-coverart/covers_db.json (maps key -> filename + meta)
- Cache: ~/.cache/hudiy-coverart/<key>.jpg
- Offline backlog: ~/.cache/hudiy-coverart/pending/<key>.json
- Cleans metadata (cut anything after "•") if Spotify adds "video available"
- Source allowlist (MediaSource): only STORAGE and A2DP (cache/DB + downloads)
- For STORAGE requests, after sending cover, embed it into the audio file (MP3/FLAC/M4A)
- One-shot library pass at startup: find MP3 without covers, download+embed in batch
And here ist the only negative point:
- the script has to run everytime you want to have coverarts while playing music via bluetooth.
At this moment i cannot provide how to put the python script in the autostart because I haven't dealt with it yet.
Big thanks goes to ChatGPT