Update Bandcamp service to latest interface changes
This commit is contained in:
@@ -9,6 +9,9 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampStreamExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -52,7 +55,7 @@ public class BandcampStreamExtractorTest {
|
||||
|
||||
@Test
|
||||
public void testDescription() {
|
||||
assertEquals(831, extractor.getDescription().length());
|
||||
assertEquals(831, extractor.getDescription().getContent().length());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -77,4 +80,19 @@ public class BandcampStreamExtractorTest {
|
||||
bandcamp.getStreamExtractor("https://bandcamp.com");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCategory() throws ExtractionException, IOException {
|
||||
StreamExtractor se = bandcamp.getStreamExtractor("https://npet.bandcamp.com/track/track-1");
|
||||
se.fetchPage();
|
||||
assertEquals("acoustic", se.getCategory());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLicense() throws ExtractionException, IOException {
|
||||
StreamExtractor se = bandcamp.getStreamExtractor("https://npet.bandcamp.com/track/track-1");
|
||||
se.fetchPage();
|
||||
assertEquals("CC BY 3.0", se.getLicence());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user