From 45bb646480b13c59d5c6f9aef53b257c51fbf0d5 Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 17 Mar 2020 20:56:47 +0100 Subject: [PATCH] [SoundCloud] Do not overwrite nextPageUrl in PlaylistExtractor Consistent with YouTube and the documentation --- .../services/soundcloud/SoundcloudPlaylistExtractor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java index 051bfc006..060b45caf 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java @@ -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); } }