Bandcamp audio stream test and fix
This commit is contained in:
parent
80d67e22b7
commit
c3d127ccd9
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue