NewPipeExtractor/extractor/src/main/java/org/schabi/newpipe/extractor/services/xh/XhService.java

118 lines
3.8 KiB
Java

package org.schabi.newpipe.extractor.services.xh;
import java.util.Arrays;
import java.util.List;
import org.schabi.newpipe.extractor.StreamingService;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
import org.schabi.newpipe.extractor.comments.CommentsExtractor;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.kiosk.KioskList;
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
import org.schabi.newpipe.extractor.search.SearchExtractor;
import org.schabi.newpipe.extractor.services.xh.extractors.XhSearchExtractor;
import org.schabi.newpipe.extractor.services.xh.extractors.XhStreamExtractor;
import org.schabi.newpipe.extractor.services.xh.linkHandler.XhSearchQueryHandlerFactory;
import org.schabi.newpipe.extractor.services.xh.linkHandler.XhStreamLinkHandlerFactory;
import org.schabi.newpipe.extractor.stream.StreamExtractor;
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
public class XhService extends StreamingService {
// name
final static String NAME = "Xhamsters";
// host
public final static String HOST = "xhamster19.desi";
public final static String BASE_URL = "https://" + HOST + "/";
// constructor
public XhService(final int id) {
super(id, NAME, Arrays.asList(VIDEO));
}
public XhService(int id, String name, List<ServiceInfo.MediaCapability> capabilities) {
super(id, NAME, Arrays.asList(VIDEO));
}
@Override
public String getBaseUrl() {
return BASE_URL;
}
@Override
public SearchExtractor getSearchExtractor(SearchQueryHandler query) {
return new XhSearchExtractor(this, query);
}
@Override
public LinkHandlerFactory getStreamLHFactory() {
return new XhStreamLinkHandlerFactory();
}
@Override
public ListLinkHandlerFactory getChannelLHFactory() {
return null;
}
@Override
public ListLinkHandlerFactory getPlaylistLHFactory() {
return null;
}
@Override
public SearchQueryHandlerFactory getSearchQHFactory() {
return XhSearchQueryHandlerFactory.getInstance();
}
@Override
public ListLinkHandlerFactory getCommentsLHFactory() {
return null;
}
@Override
public SuggestionExtractor getSuggestionExtractor() {
return null;
}
@Override
public SubscriptionExtractor getSubscriptionExtractor() {
return null;
}
@Override
public KioskList getKioskList() throws ExtractionException {
// Return Empty List
// patch: if (kioskId == null) { return "" }
KioskList list = new KioskList(this);
return list;
}
@Override
public ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler) throws ExtractionException {
return null;
}
@Override
public PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandler) throws ExtractionException {
return null;
}
@Override
public StreamExtractor getStreamExtractor(LinkHandler linkHandler) throws ExtractionException {
return new XhStreamExtractor(this, linkHandler);
}
@Override
public CommentsExtractor getCommentsExtractor(ListLinkHandler linkHandler) throws ExtractionException {
return null;
}
}