From 80d67e22b7185596968e907b942b1f0f5acbc502 Mon Sep 17 00:00:00 2001 From: Fynn Godau Date: Sat, 21 Dec 2019 19:31:46 +0100 Subject: [PATCH] Return mp3-128 audio stream [experimental] --- .../bandcamp/extractors/BandcampStreamExtractor.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java index 0bb100c09..8ab4f8ce7 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java @@ -18,6 +18,7 @@ import org.schabi.newpipe.extractor.stream.*; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.IOException; +import java.util.ArrayList; import java.util.List; public class BandcampStreamExtractor extends StreamExtractor { @@ -177,7 +178,14 @@ public class BandcampStreamExtractor extends StreamExtractor { @Override public List getAudioStreams() throws IOException, ExtractionException { - return null; + List audioStreams = new ArrayList<>(); + + audioStreams.add(new AudioStream( + albumJson.getJSONArray("trackinfo").getJSONObject(0) + .getJSONArray("file").getJSONObject(0).getString("mp3-128"), + MediaFormat.MP3, 128 + )); + return audioStreams; } @Override @@ -204,7 +212,7 @@ public class BandcampStreamExtractor extends StreamExtractor { @Override public StreamType getStreamType() throws ParsingException { - return null; + return StreamType.AUDIO_STREAM; } @Override