[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
1 changed files with 4 additions and 4 deletions

View File

@ -169,14 +169,14 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
+ "&ids=").length();
final int lengthOfEveryStream = 11;
String currentPageUrl;
String currentPageUrl, nextUrl;
int lengthMaxStreams = lengthFirstPartOfUrl + lengthOfEveryStream * streamsPerRequestedPage;
if (pageUrl.length() <= lengthMaxStreams) {
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 {
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());
@ -193,6 +193,6 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
throw new ParsingException("Could not parse json response", e);
}
return new InfoItemsPage<>(collector, nextPageUrl);
return new InfoItemsPage<>(collector, nextUrl);
}
}