set default kiosk for youtube

This commit is contained in:
Christian Schabesberger 2017-09-23 15:59:00 +02:00
parent 78d461ed89
commit b37b24511f
3 changed files with 11 additions and 2 deletions

View File

@ -30,11 +30,15 @@ import java.io.IOException;
public class KioskInfo extends ListInfo {
public String type;
public static ListExtractor.NextItemsResult getMoreItems(ServiceList serviceItem, String url, String nextStreamsUrl) throws IOException, ExtractionException {
public static ListExtractor.NextItemsResult getMoreItems(ServiceList serviceItem,
String url,
String nextStreamsUrl) throws IOException, ExtractionException {
return getMoreItems(serviceItem.getService(), url, nextStreamsUrl);
}
public static ListExtractor.NextItemsResult getMoreItems(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
public static ListExtractor.NextItemsResult getMoreItems(StreamingService service,
String url,
String nextStreamsUrl) throws IOException, ExtractionException {
KioskList kl = service.getKioskList();
KioskExtractor extractor = kl.getExtryctorByUrl(url, nextStreamsUrl);
return extractor.getNextStreams();

View File

@ -67,6 +67,10 @@ public class KioskList {
}
}
public String getDefaultKioskType() {
return defaultKiosk;
}
public KioskExtractor getExtractorByType(String kioskType, String nextStreamsUrl)
throws ExtractionException, IOException {
KioskEntry ke = kioskList.get(kioskType);

View File

@ -95,6 +95,7 @@ public class YoutubeService extends StreamingService {
return new YoutubeTrendingExtractor(YoutubeService.this, url, nextStreamUrl);
}
}, new YoutubeTrendingUrlIdHandler());
list.setDefaultKiosk("Trending");
} catch (Exception e) {
throw new ExtractionException(e);
}