Workaround enourmous load times for long bandcamp playlists

Additionally, get cover art from json instead of html
This commit is contained in:
Fynn Godau
2020-01-03 13:13:42 +01:00
parent 46e1f3922c
commit ba967f1a15
4 changed files with 50 additions and 18 deletions

View File

@@ -52,6 +52,22 @@ public class BandcampPlaylistExtractorTest {
assertNotEquals(extractor.getThumbnailUrl(), l.get(5).getThumbnailUrl());
}
/**
* Tests that no attempt to load every track's cover individually is made
*/
@Test(timeout = 10000L)
public void testDifferentTrackCoversDuration() throws ExtractionException, IOException {
PlaylistExtractor extractor = bandcamp.getPlaylistExtractor("https://infiniteammo.bandcamp.com/album/night-in-the-woods-vol-1-at-the-end-of-everything");
extractor.fetchPage();
/* All tracks in this album have the same cover art, but I don't know any albums with more than 10 tracks
* that has at least one track with a cover art different from the rest.
*/
List<StreamInfoItem> l = extractor.getInitialPage().getItems();
assertEquals(extractor.getThumbnailUrl(), l.get(0).getThumbnailUrl());
assertEquals(extractor.getThumbnailUrl(), l.get(5).getThumbnailUrl());
}
/**
* Test playlists with locked content
*/

View File

@@ -34,7 +34,6 @@ public class BandcampRadioExtractorTest {
@Test
public void testRadioCount() throws ExtractionException, IOException {
List<InfoItem> list = bandcamp.getKioskList().getExtractorById("Radio", null).getInitialPage().getItems();
System.out.println(list.size());
assertTrue(list.size() > 300);
}
}