[Bandcamp] Fix regression of Opus radio streams extraction

When moving opus-lo into a constant, opus-lo was renamed to opus_lo and was only used if no MP3 stream was available (which was not the case before the changes in BandcampRadioStreamExtractor related to the addition of the support of all delivery methods), so these changes removed the ability to get Opus streams of Bandcamp radios.

This commit reverts this unwanted change.
This commit is contained in:
TiA4f8R 2022-05-07 19:23:21 +02:00
parent 54d323c2ae
commit 4158fc46a0
No known key found for this signature in database
GPG key ID: E6D3E7F5949450DD

View file

@ -33,7 +33,7 @@ import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
public class BandcampRadioStreamExtractor extends BandcampStreamExtractor { public class BandcampRadioStreamExtractor extends BandcampStreamExtractor {
private static final String OPUS_LO = "opus_lo"; private static final String OPUS_LO = "opus-lo";
private static final String MP3_128 = "mp3-128"; private static final String MP3_128 = "mp3-128";
private JsonObject showInfo; private JsonObject showInfo;
@ -126,7 +126,9 @@ public class BandcampRadioStreamExtractor extends BandcampStreamExtractor {
.setMediaFormat(MediaFormat.MP3) .setMediaFormat(MediaFormat.MP3)
.setAverageBitrate(128) .setAverageBitrate(128)
.build()); .build());
} else if (streams.has(OPUS_LO)) { }
if (streams.has(OPUS_LO)) {
audioStreams.add(new AudioStream.Builder() audioStreams.add(new AudioStream.Builder()
.setId(OPUS_LO) .setId(OPUS_LO)
.setContent(streams.getString(OPUS_LO), true) .setContent(streams.getString(OPUS_LO), true)