22
33package org .schabi .newpipe .extractor .services .bandcamp ;
44
5+ import static org .schabi .newpipe .extractor .StreamingService .ServiceInfo .MediaCapability .AUDIO ;
6+ import static org .schabi .newpipe .extractor .StreamingService .ServiceInfo .MediaCapability .COMMENTS ;
7+ import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampExtractorHelper .BASE_URL ;
8+ import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampFeaturedExtractor .FEATURED_API_URL ;
9+ import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampFeaturedExtractor .KIOSK_FEATURED ;
10+ import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampRadioExtractor .KIOSK_RADIO ;
11+ import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampRadioExtractor .RADIO_API_URL ;
12+
513import org .schabi .newpipe .extractor .StreamingService ;
614import org .schabi .newpipe .extractor .channel .ChannelExtractor ;
715import org .schabi .newpipe .extractor .comments .CommentsExtractor ;
816import org .schabi .newpipe .extractor .exceptions .ExtractionException ;
917import org .schabi .newpipe .extractor .kiosk .KioskList ;
10- import org .schabi .newpipe .extractor .linkhandler .*;
18+ import org .schabi .newpipe .extractor .linkhandler .LinkHandler ;
19+ import org .schabi .newpipe .extractor .linkhandler .LinkHandlerFactory ;
20+ import org .schabi .newpipe .extractor .linkhandler .ListLinkHandler ;
21+ import org .schabi .newpipe .extractor .linkhandler .ListLinkHandlerFactory ;
22+ import org .schabi .newpipe .extractor .linkhandler .SearchQueryHandler ;
23+ import org .schabi .newpipe .extractor .linkhandler .SearchQueryHandlerFactory ;
1124import org .schabi .newpipe .extractor .playlist .PlaylistExtractor ;
1225import org .schabi .newpipe .extractor .search .SearchExtractor ;
13- import org .schabi .newpipe .extractor .services .bandcamp .extractors .*;
14- import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .*;
26+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampChannelExtractor ;
27+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampCommentsExtractor ;
28+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampExtractorHelper ;
29+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampFeaturedExtractor ;
30+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampPlaylistExtractor ;
31+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampRadioExtractor ;
32+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampRadioStreamExtractor ;
33+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampSearchExtractor ;
34+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampStreamExtractor ;
35+ import org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampSuggestionExtractor ;
36+ import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .BandcampChannelLinkHandlerFactory ;
37+ import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .BandcampCommentsLinkHandlerFactory ;
38+ import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .BandcampFeaturedLinkHandlerFactory ;
39+ import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .BandcampPlaylistLinkHandlerFactory ;
40+ import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .BandcampSearchQueryHandlerFactory ;
41+ import org .schabi .newpipe .extractor .services .bandcamp .linkHandler .BandcampStreamLinkHandlerFactory ;
1542import org .schabi .newpipe .extractor .stream .StreamExtractor ;
1643import org .schabi .newpipe .extractor .subscription .SubscriptionExtractor ;
1744import org .schabi .newpipe .extractor .suggestion .SuggestionExtractor ;
1845
1946import java .util .Arrays ;
20- import java .util .Collections ;
21-
22- import static org .schabi .newpipe .extractor .StreamingService .ServiceInfo .MediaCapability .AUDIO ;
23- import static org .schabi .newpipe .extractor .StreamingService .ServiceInfo .MediaCapability .COMMENTS ;
24- import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampExtractorHelper .BASE_URL ;
25- import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampFeaturedExtractor .FEATURED_API_URL ;
26- import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampFeaturedExtractor .KIOSK_FEATURED ;
27- import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampRadioExtractor .KIOSK_RADIO ;
28- import static org .schabi .newpipe .extractor .services .bandcamp .extractors .BandcampRadioExtractor .RADIO_API_URL ;
2947
3048public class BandcampService extends StreamingService {
3149
@@ -81,19 +99,28 @@ public SubscriptionExtractor getSubscriptionExtractor() {
8199 @ Override
82100 public KioskList getKioskList () throws ExtractionException {
83101
84- KioskList kioskList = new KioskList (this );
102+ final KioskList kioskList = new KioskList (this );
85103
86104 try {
87- kioskList .addKioskEntry ((streamingService , url , kioskId ) ->
88- new BandcampFeaturedExtractor (
89- BandcampService .this ,
90- new BandcampFeaturedLinkHandlerFactory ().fromUrl (FEATURED_API_URL ), kioskId ),
91- new BandcampFeaturedLinkHandlerFactory (), KIOSK_FEATURED );
92-
93- kioskList .addKioskEntry ((streamingService , url , kioskId ) ->
94- new BandcampRadioExtractor (BandcampService .this ,
95- new BandcampFeaturedLinkHandlerFactory ().fromUrl (RADIO_API_URL ), kioskId ),
96- new BandcampFeaturedLinkHandlerFactory (), KIOSK_RADIO );
105+ kioskList .addKioskEntry (
106+ (streamingService , url , kioskId ) -> new BandcampFeaturedExtractor (
107+ BandcampService .this ,
108+ new BandcampFeaturedLinkHandlerFactory ().fromUrl (FEATURED_API_URL ),
109+ kioskId
110+ ),
111+ new BandcampFeaturedLinkHandlerFactory (),
112+ KIOSK_FEATURED
113+ );
114+
115+ kioskList .addKioskEntry (
116+ (streamingService , url , kioskId ) -> new BandcampRadioExtractor (
117+ BandcampService .this ,
118+ new BandcampFeaturedLinkHandlerFactory ().fromUrl (RADIO_API_URL ),
119+ kioskId
120+ ),
121+ new BandcampFeaturedLinkHandlerFactory (),
122+ KIOSK_RADIO
123+ );
97124
98125 kioskList .setDefaultKiosk (KIOSK_FEATURED );
99126
@@ -116,14 +143,14 @@ public PlaylistExtractor getPlaylistExtractor(final ListLinkHandler linkHandler)
116143
117144 @ Override
118145 public StreamExtractor getStreamExtractor (final LinkHandler linkHandler ) {
119- if (BandcampExtractorHelper .isRadioUrl (linkHandler .getUrl ()))
146+ if (BandcampExtractorHelper .isRadioUrl (linkHandler .getUrl ())) {
120147 return new BandcampRadioStreamExtractor (this , linkHandler );
121- else
122- return new BandcampStreamExtractor (this , linkHandler );
148+ }
149+ return new BandcampStreamExtractor (this , linkHandler );
123150 }
124151
125152 @ Override
126- public CommentsExtractor getCommentsExtractor (ListLinkHandler linkHandler ) {
153+ public CommentsExtractor getCommentsExtractor (final ListLinkHandler linkHandler ) {
127154 return new BandcampCommentsExtractor (this , linkHandler );
128155 }
129156}
0 commit comments