[SoundCloud] Fix extractors built from next playlist pages

They didn't have the information to calculate another next page url. So now `nextPageUrl` contains a full link with all video ids, and `getPage` takes the first part of the url (containing 15 streams) and produces another `nextPageUrl` with the remaining streams.
Also add a test for this.
This commit is contained in:
Stypox
2020-03-17 18:04:40 +01:00
parent 0e1b4bbf17
commit 5e4ddb368f
2 changed files with 39 additions and 32 deletions

View File

@@ -234,6 +234,15 @@ public class SoundcloudPlaylistExtractorTest {
public void testGetPageInNewExtractor() throws Exception {
final PlaylistExtractor newExtractor = SoundCloud.getPlaylistExtractor(extractor.getUrl());
defaultTestGetPageInNewExtractor(extractor, newExtractor);
String page1 = newExtractor.getNextPageUrl();
defaultTestMoreItems(newExtractor); // there has to be another page
String page2 = newExtractor.getNextPageUrl();
defaultTestMoreItems(newExtractor); // and another one
String page3 = newExtractor.getNextPageUrl();
assertNotEquals("Same pages", page1, page2);
assertNotEquals("Same pages", page2, page3);
assertNotEquals("Same pages", page3, page1);
}
/*//////////////////////////////////////////////////////////////////////////