mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-15 06:40:33 +05:30
Use clean url and id when creating a channel info
This commit is contained in:
parent
033a9fb8e3
commit
5c0c35064c
@ -5,9 +5,7 @@ import org.schabi.newpipe.extractor.ListInfo;
|
|||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
|
||||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||||
import org.schabi.newpipe.extractor.localization.Localization;
|
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
import org.schabi.newpipe.extractor.utils.ExtractorHelper;
|
import org.schabi.newpipe.extractor.utils.ExtractorHelper;
|
||||||
|
|
||||||
@ -35,8 +33,8 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class ChannelInfo extends ListInfo<StreamInfoItem> {
|
public class ChannelInfo extends ListInfo<StreamInfoItem> {
|
||||||
|
|
||||||
public ChannelInfo(int serviceId, ListLinkHandler linkHandler, String name) throws ParsingException {
|
public ChannelInfo(int serviceId, String id, String url, String originalUrl, String name, ListLinkHandler listLinkHandler) {
|
||||||
super(serviceId, linkHandler, name);
|
super(serviceId, id, url, originalUrl, name, listLinkHandler.getContentFilters(), listLinkHandler.getSortFilter());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChannelInfo getInfo(String url) throws IOException, ExtractionException {
|
public static ChannelInfo getInfo(String url) throws IOException, ExtractionException {
|
||||||
@ -57,15 +55,14 @@ public class ChannelInfo extends ListInfo<StreamInfoItem> {
|
|||||||
|
|
||||||
public static ChannelInfo getInfo(ChannelExtractor extractor) throws IOException, ExtractionException {
|
public static ChannelInfo getInfo(ChannelExtractor extractor) throws IOException, ExtractionException {
|
||||||
|
|
||||||
ChannelInfo info = new ChannelInfo(extractor.getServiceId(),
|
final int serviceId = extractor.getServiceId();
|
||||||
extractor.getLinkHandler(),
|
final String id = extractor.getId();
|
||||||
extractor.getName());
|
final String url = extractor.getUrl();
|
||||||
|
final String originalUrl = extractor.getOriginalUrl();
|
||||||
|
final String name = extractor.getName();
|
||||||
|
|
||||||
|
final ChannelInfo info = new ChannelInfo(serviceId, id, url, originalUrl, name, extractor.getLinkHandler());
|
||||||
|
|
||||||
try {
|
|
||||||
info.setOriginalUrl(extractor.getOriginalUrl());
|
|
||||||
} catch (Exception e) {
|
|
||||||
info.addError(e);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
info.setAvatarUrl(extractor.getAvatarUrl());
|
info.setAvatarUrl(extractor.getAvatarUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user