fix exception

This commit is contained in:
CypherpunkSamurai 2023-02-16 19:56:03 +05:30
parent 9aab6148ba
commit bc6c643a2a
4 changed files with 31 additions and 27 deletions

View file

@ -21,7 +21,7 @@ public abstract class Extractor {
* cleaning/accepting/get id from urls).
*/
private final StreamingService service;
private final LinkHandler linkHandler;
public final LinkHandler linkHandler;
@Nullable
private Localization forcedLocalization = null;

View file

@ -16,6 +16,7 @@ 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.stream.StreamExtractor;
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
@ -39,65 +40,66 @@ public class XhService extends StreamingService {
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() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public ListLinkHandlerFactory getChannelLHFactory() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public ListLinkHandlerFactory getPlaylistLHFactory() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public SearchQueryHandlerFactory getSearchQHFactory() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public ListLinkHandlerFactory getCommentsLHFactory() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public SearchExtractor getSearchExtractor(SearchQueryHandler queryHandler) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public SuggestionExtractor getSuggestionExtractor() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public SubscriptionExtractor getSubscriptionExtractor() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public KioskList getKioskList() throws ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler) throws ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
public PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandler) throws ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
@Override
@ -107,6 +109,6 @@ public class XhService extends StreamingService {
@Override
public CommentsExtractor getCommentsExtractor(ListLinkHandler linkHandler) throws ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return null;
}
}

View file

@ -29,6 +29,7 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
import org.schabi.newpipe.extractor.search.SearchExtractor;
import org.schabi.newpipe.extractor.services.xh.XhService;
import static org.schabi.newpipe.extractor.services.xh.XhService.HOST;
import org.schabi.newpipe.extractor.services.xh.extractors.items.XhVideo;
@ -37,9 +38,9 @@ import org.schabi.newpipe.extractor.services.xh.extractors.items.XhVideo;
* @author Rakesh
*/
public class XhSearchExtractor extends SearchExtractor {
public XhSearchExtractor(StreamingService service, SearchQueryHandler linkHandler) {
super(service, linkHandler);
public XhSearchExtractor(final StreamingService service, final SearchQueryHandler query) {
super(service, query);
}
@NonNull
@ -60,7 +61,10 @@ public class XhSearchExtractor extends SearchExtractor {
@Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
Page p = new Page(this.linkHandler.getUrl());
return getPage(p);
}
@Override
@ -125,8 +129,6 @@ public class XhSearchExtractor extends SearchExtractor {
}
@Override
public void onFetchPage(Downloader downloader) throws IOException, ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public void onFetchPage(Downloader downloader) throws IOException, ExtractionException {}
}

View file

@ -100,7 +100,7 @@ public class XhStreamExtractor extends StreamExtractor {
@Override
public String getUploaderUrl() throws ParsingException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return "";
}
@Override
@ -152,7 +152,7 @@ public class XhStreamExtractor extends StreamExtractor {
@Override
public void onFetchPage(Downloader downloader) throws IOException, ExtractionException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override