mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 05:15:49 +03:00
[GH-ISSUE #255] Feature Request: Higher resolution album art (640×640 instead of 300×300) #159
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @leodurandfr on GitHub (Nov 13, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/255
Hi!
While experimenting with album art URLs returned by go-librespot, I noticed that the API currently retrieves the 300×300 version of Spotify images. However, Spotify also provides a higher resolution version (640×640) using the exact same hash.
What I found
Spotify image URLs follow a predictable pattern.
The size variant seems to depend on a specific segment inside the URL:
00001e02→ 300×3000000b273→ 640×640By replacing the size segment returned by go-librespot (
1e02) withb273, the image is requested in its higher-resolution form.Examples
300×300 (current go-librespot output):
640×640 (simply replacing
1e02withb273):Would it be possible to:
--image-size=max) ?I'd be happy to test or help with implementation if needed.
@devgianlu commented on GitHub (Nov 30, 2025):
@leodurandfr @breadsander Let me know if #262 does the job for you (already merged).
@leodurandfr commented on GitHub (Nov 30, 2025):
Thanks a lot for this update!
After testing commit
a80ad107which adds theimage_sizeconfiguration option, I noticed thatxlargedoesn't return larger images whilelargeworks correctly.Configuration
Observations
With image_size: "large" ✅
API returns: https://i.scdn.co/image/ab67616d0000b27341708165385c6f253ea5cacc
With image_size: "xlarge" ❌
API returns: https://i.scdn.co/image/ab67616d00001e0241708165385c6f253ea5cacc
Analysis
It appears that Spotify's track metadata (track.Album.Cover) only includes images with sizes DEFAULT, SMALL, and LARGE, but not XLARGE. The getBestImageIdForSize() function correctly looks for the requested
size, but since no XLARGE image is present in the metadata, it falls back to the first available image (DEFAULT).
Possible solutions
large(640×640) is the maximum available size for album covers, and consider removing thexlargeoption?Environment
a80ad107Thanks again for adding this feature! The large option already provides a significant improvement
@devgianlu commented on GitHub (Nov 30, 2025):
It should probably fallback to large if xlarge is not available, will fix this.
@leodurandfr commented on GitHub (Nov 30, 2025):
Did you manage to retrieve any album art in xlarge (larger than 640×640)?
@devgianlu commented on GitHub (Nov 30, 2025):
I think all I could test was large