Skip to content

Commit 2d6aa02

Browse files
authored
temporary fixes to CDN feed helper which avoid the broken CDN server (#779)
* temporary fixes to CDN feed helper which avoid the broken CDN server audio4-gm-fb * remove commented code for real CDN selection
1 parent c8cf8d2 commit 2d6aa02

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/src/main/java/xyz/gianlu/librespot/audio/cdn/CdnFeedHelper.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ private CdnFeedHelper() {
4646

4747
@NotNull
4848
private static HttpUrl getUrl(@NotNull Session session, @NotNull StorageResolveResponse resp) {
49-
return HttpUrl.get(resp.getCdnurl(session.random().nextInt(resp.getCdnurlCount())));
49+
String selectedUrl = resp.getCdnurl(session.random().nextInt(resp.getCdnurlCount()));
50+
while (selectedUrl.contains("audio4-gm-fb")) {
51+
LOGGER.warn("getUrl picked CDN with known issues {} (forcing re-selection)", selectedUrl );
52+
selectedUrl = resp.getCdnurl(session.random().nextInt(resp.getCdnurlCount()));
53+
}
54+
return HttpUrl.get(selectedUrl);
5055
}
5156

5257
public static @NotNull LoadedStream loadTrack(@NotNull Session session, Metadata.@NotNull Track track, Metadata.@NotNull AudioFile file,

0 commit comments

Comments
 (0)