MD5 校验值:61e58c10a11e4adec8760ee3854e996a
BandcampRadioStreamExtractor.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package org.schabi.newpipe.extractor.services.bandcamp.extractors; import R5.a; import S5.l; import V1.z; import a4.C0230a; import a4.c; import a4.d; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import org.schabi.newpipe.extractor.Image; import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; import org.schabi.newpipe.extractor.linkhandler.LinkHandler; import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemsCollector; import org.schabi.newpipe.extractor.stream.AudioStream; import org.schabi.newpipe.extractor.stream.Description; import org.schabi.newpipe.extractor.stream.StreamSegment; import v0.AbstractC2363a; public class BandcampRadioStreamExtractor extends BandcampStreamExtractor { private static final String MP3_128 = "mp3-128"; private static final String OPUS_LO = "opus-lo"; private c showInfo; public BandcampRadioStreamExtractor(StreamingService streamingService, LinkHandler linkHandler) { super(streamingService, linkHandler); } public static ParsingException lambda$getUploaderName$0() { return new ParsingException("Could not get uploader name"); } public static c query(int i5) { try { return (c) z.h().H(NewPipe.getDownloader().get("https://bandcamp.com/api/bcweekly/1/get?id=" + i5).responseBody()); } catch (d | IOException | ReCaptchaException e) { throw new ParsingException("could not get show data", e); } } @Override public List<AudioStream> getAudioStreams() { ArrayList arrayList = new ArrayList(); c f7 = this.showInfo.f("audio_stream"); if (f7.containsKey(MP3_128)) { arrayList.add(new AudioStream.Builder().setId(MP3_128).setContent(f7.h(MP3_128, null), true).setMediaFormat(MediaFormat.MP3).setAverageBitrate(128).build()); } if (f7.containsKey(OPUS_LO)) { arrayList.add(new AudioStream.Builder().setId(OPUS_LO).setContent(f7.h(OPUS_LO, null), true).setMediaFormat(MediaFormat.OPUS).setAverageBitrate(100).build()); } return arrayList; } @Override public String getCategory() { return ""; } @Override public Description getDescription() { return new Description(this.showInfo.h("desc", null), 3); } @Override public long getLength() { return this.showInfo.e(0L, "audio_duration"); } @Override public String getLicence() { return ""; } @Override public String getName() { return this.showInfo.h("subtitle", null); } @Override public List<StreamSegment> getStreamSegments() { C0230a b7 = this.showInfo.b("tracks"); ArrayList arrayList = new ArrayList(b7.size()); Iterator<E> it = b7.iterator(); while (it.hasNext()) { c cVar = (c) it.next(); StreamSegment streamSegment = new StreamSegment(cVar.h("title", null), cVar.d(0, "timecode")); streamSegment.setPreviewUrl(BandcampExtractorHelper.getImageUrl(cVar.e(0L, "track_art_id"), true)); streamSegment.setChannelName(cVar.h("artist", null)); arrayList.add(streamSegment); } return arrayList; } @Override public List<String> getTags() { return Collections.emptyList(); } @Override public String getTextualUploadDate() { return this.showInfo.h("published_date", null); } @Override public List<Image> getThumbnails() { return BandcampExtractorHelper.getImagesFromImageId(this.showInfo.e(0L, "show_image_id"), false); } @Override public List<Image> getUploaderAvatars() { return Collections.singletonList(new Image("https://bandcamp.com/img/buttons/bandcamp-button-circle-whitecolor-512.png", 512, 512, Image.ResolutionLevel.MEDIUM)); } @Override public String getUploaderName() { return (String) AbstractC2363a.w(this.showInfo.h("image_caption", null)).K("a").stream().map(new l(22)).findFirst().orElseThrow(new a(9)); } @Override public String getUploaderUrl() { throw new ContentNotSupportedException("Fan pages are not supported"); } @Override public String getUrl() { return getLinkHandler().getUrl(); } @Override public void onFetchPage(Downloader downloader) { this.showInfo = query(Integer.parseInt(getId())); } @Override public PlaylistInfoItemsCollector getRelatedItems() { return null; } }