[SoundCloud] Do not overwrite nextPageUrl in PlaylistExtractor

Consistent with YouTube and the documentation
This commit is contained in:
Stypox 2020-03-17 20:56:47 +01:00
parent c505d4e2b7
commit 45bb646480
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -169,14 +169,14 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
+ "&ids=").length(); + "&ids=").length();
final int lengthOfEveryStream = 11; final int lengthOfEveryStream = 11;
String currentPageUrl; String currentPageUrl, nextUrl;
int lengthMaxStreams = lengthFirstPartOfUrl + lengthOfEveryStream * streamsPerRequestedPage; int lengthMaxStreams = lengthFirstPartOfUrl + lengthOfEveryStream * streamsPerRequestedPage;
if (pageUrl.length() <= lengthMaxStreams) { if (pageUrl.length() <= lengthMaxStreams) {
currentPageUrl = pageUrl; // fetch every remaining video, there are less than the max currentPageUrl = pageUrl; // fetch every remaining video, there are less than the max
nextPageUrl = ""; // afterwards the list is complete nextUrl = ""; // afterwards the list is complete
} else { } else {
currentPageUrl = pageUrl.substring(0, lengthMaxStreams); currentPageUrl = pageUrl.substring(0, lengthMaxStreams);
nextPageUrl = pageUrl.substring(0, lengthFirstPartOfUrl) + pageUrl.substring(lengthMaxStreams); nextUrl = pageUrl.substring(0, lengthFirstPartOfUrl) + pageUrl.substring(lengthMaxStreams);
} }
StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId()); StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
@ -193,6 +193,6 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
throw new ParsingException("Could not parse json response", e); throw new ParsingException("Could not parse json response", e);
} }
return new InfoItemsPage<>(collector, nextPageUrl); return new InfoItemsPage<>(collector, nextUrl);
} }
} }