Fix SoundCloud playlists parsing exception

Closes TeamNewPipe/NewPipe#2344
This commit is contained in:
TobiGr 2019-06-26 00:56:03 +02:00
parent c64c90a567
commit 0d09a9fd61

View File

@ -113,6 +113,9 @@ public class SoundcloudParsingHelper {
String response = NewPipe.getDownloader().download("https://w.soundcloud.com/player/?url="
+ URLEncoder.encode(url, "UTF-8"));
// handle playlists / sets different and get playlist id via uir field in JSON
if (url.contains("sets") && !url.endsWith("sets") && !url.endsWith("sets/"))
return Parser.matchGroup1("\"uri\":\\s*\"https:\\/\\/api\\.soundcloud\\.com\\/playlists\\/((\\d)*?)\"", response);
return Parser.matchGroup1(",\"id\":(([^}\\n])*?),", response);
}