diff --git a/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudDataReader.java b/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudDataReader.java index b75e60ad7..83351f3ad 100644 --- a/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudDataReader.java +++ b/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudDataReader.java @@ -90,11 +90,8 @@ public List readPlaylistTracks(JsonBrowser playlistData) { protected JsonBrowser findEntryOfKind(JsonBrowser data, String kind) { for (JsonBrowser value : data.values()) { - for (JsonBrowser entry : value.get("data").values()) { - if (entry.isMap() && kind.equals(entry.get("kind").text())) { - return entry; - } - } + if (value.isMap() && kind.equals(value.get("data").get("kind").safeText())) { + return value.get("data"); } return null; diff --git a/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudHtmlDataLoader.java b/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudHtmlDataLoader.java index 57bc048ce..03b9b1d28 100644 --- a/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudHtmlDataLoader.java +++ b/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/soundcloud/DefaultSoundCloudHtmlDataLoader.java @@ -22,6 +22,7 @@ public class DefaultSoundCloudHtmlDataLoader implements SoundCloudHtmlDataLoader private static final Logger log = LoggerFactory.getLogger(DefaultSoundCloudHtmlDataLoader.class); private static final TextRange[] JSON_RANGES = { + new TextRange("window.__sc_hydration = ", ";"), new TextRange("catch(e){}})},", ");"), new TextRange("){}})},", ");") };