Bandcamp audio stream test and fix

This commit is contained in:
Fynn Godau 2019-12-21 21:47:06 +01:00
parent 80d67e22b7
commit c3d127ccd9
2 changed files with 12 additions and 6 deletions

View File

@ -177,36 +177,36 @@ public class BandcampStreamExtractor extends StreamExtractor {
}
@Override
public List<AudioStream> getAudioStreams() throws IOException, ExtractionException {
public List<AudioStream> getAudioStreams() {
List<AudioStream> audioStreams = new ArrayList<>();
audioStreams.add(new AudioStream(
albumJson.getJSONArray("trackinfo").getJSONObject(0)
.getJSONArray("file").getJSONObject(0).getString("mp3-128"),
.getJSONObject("file").getString("mp3-128"),
MediaFormat.MP3, 128
));
return audioStreams;
}
@Override
public List<VideoStream> getVideoStreams() throws IOException, ExtractionException {
public List<VideoStream> getVideoStreams() {
return null;
}
@Override
public List<VideoStream> getVideoOnlyStreams() throws IOException, ExtractionException {
public List<VideoStream> getVideoOnlyStreams() {
return null;
}
@Nonnull
@Override
public List<SubtitlesStream> getSubtitlesDefault() throws IOException, ExtractionException {
public List<SubtitlesStream> getSubtitlesDefault() {
return null;
}
@Nonnull
@Override
public List<SubtitlesStream> getSubtitles(MediaFormat format) throws IOException, ExtractionException {
public List<SubtitlesStream> getSubtitles(MediaFormat format) {
return null;
}

View File

@ -61,4 +61,10 @@ public class BandcampStreamExtractorTest {
assertTrue(url.contains("://f4.bcbits.com/img/") && url.endsWith(".jpg"));
}
@Test
public void testAudioStream() {
assertTrue(extractor.getAudioStreams().get(0).getUrl().contains("bcbits.com/stream"));
assertEquals(1, extractor.getAudioStreams().size());
}
}