Skip to content

Commit 2fa21f1

Browse files
committed
fix spotify playlists still using anonymous tokens
1 parent eef97cf commit 2fa21f1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ plugins:
129129
albumLoadLimit: 6 # The number of pages at 50 tracks each
130130
resolveArtistsInSearch: true # Whether to resolve artists in track search results (can be slow)
131131
localFiles: false # Enable local files support with Spotify playlists. Please note `uri` & `isrc` will be `null` & `identifier` will be `"local"`
132-
preferAnonymousToken: true # Whether to use the anonymous token for resolving tracks, artists and albums. Playlists are always resolved with the anonymous token to support autogenerated playlists.
133-
customAnonymousTokenEndpoint: "http://localhost/api/token" # Optional custom endpoint for getting the anonymous token. If not set, spotify's default endpoint will be used which might not work. The response must match spotify's anonymous token response format.
132+
preferAnonymousToken: false # Whether to use the anonymous token for resolving tracks, artists and albums. Spotify generated playlists are always resolved with the anonymous tokens since they do not work otherwise. This requires the customAnonymousTokenEndpoint to be set.
133+
customAnonymousTokenEndpoint: "http://localhost:8080/api/token" # Optional custom endpoint for getting the anonymous token. If not set, spotify's default endpoint will be used which might not work. The response must match spotify's anonymous token response format.
134134
applemusic:
135135
countryCode: "US" # the country code you want to use for filtering the artists top tracks and language. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
136136
mediaAPIToken: "your apple music api token" # apple music api token

application.example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ plugins:
3333
albumLoadLimit: 6 # The number of pages at 50 tracks each
3434
resolveArtistsInSearch: true # Whether to resolve artists in track search results (can be slow)
3535
localFiles: false # Enable local files support with Spotify playlists. Please note `uri` & `isrc` will be `null` & `identifier` will be `"local"`
36-
preferAnonymousToken: true # Whether to use the anonymous token for resolving tracks, artists and albums. Playlists are always resolved with the anonymous token to support autogenerated playlists.
37-
customAnonymousTokenEndpoint: "http://localhost/api/token" # Optional custom endpoint for getting the anonymous token. If not set, spotify's default endpoint will be used which might not work. The response must match spotify's anonymous token response format.
36+
preferAnonymousToken: false # Whether to use the anonymous token for resolving tracks, artists and albums. Spotify generated playlists are always resolved with the anonymous tokens since they do not work otherwise. This requires the customAnonymousTokenEndpoint to be set.
37+
customAnonymousTokenEndpoint: "http://localhost:8080/api/token" # Optional custom endpoint for getting the anonymous token. If not set, spotify's default endpoint will be used which might not work. The response must match spotify's anonymous token response format.
3838
applemusic:
3939
countryCode: "US" # the country code you want to use for filtering the artists top tracks and language. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
4040
mediaAPIToken: "your apple music api token" # apple music api token

main/src/main/java/com/github/topi314/lavasrc/spotify/SpotifySourceManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public AudioItem getPlaylist(String id, boolean preview) throws IOException {
442442
var offset = 0;
443443
var pages = 0;
444444
do {
445-
page = this.getJson(API_BASE + "playlists/" + id + "/tracks?limit=" + PLAYLIST_MAX_PAGE_ITEMS + "&offset=" + offset, true, false);
445+
page = this.getJson(API_BASE + "playlists/" + id + "/tracks?limit=" + PLAYLIST_MAX_PAGE_ITEMS + "&offset=" + offset, anonymous, this.preferAnonymousToken);
446446
offset += PLAYLIST_MAX_PAGE_ITEMS;
447447

448448
for (var value : page.get("items").values()) {

0 commit comments

Comments
 (0)