Fix dash parser and more refactor
- Add new itags
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.channel;
|
||||
|
||||
import org.schabi.newpipe.extractor.Extractor;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.UrlIdHandler;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
|
||||
@@ -29,21 +29,16 @@ import java.util.List;
|
||||
|
||||
public class ChannelInfo extends Info {
|
||||
|
||||
public static ChannelInfo getInfo(ChannelExtractor extractor)
|
||||
throws ParsingException {
|
||||
public static ChannelInfo getInfo(ChannelExtractor extractor) throws ParsingException {
|
||||
ChannelInfo info = new ChannelInfo();
|
||||
|
||||
// important data
|
||||
info.service_id = extractor.getServiceId();
|
||||
info.url = extractor.getUrl();
|
||||
info.id = extractor.getChannelId();
|
||||
info.name = extractor.getChannelName();
|
||||
info.hasMoreStreams = extractor.hasMoreStreams();
|
||||
info.has_more_streams = extractor.hasMoreStreams();
|
||||
|
||||
try {
|
||||
info.id = extractor.getChannelId();
|
||||
} catch (Exception e) {
|
||||
info.errors.add(e);
|
||||
}
|
||||
try {
|
||||
info.avatar_url = extractor.getAvatarUrl();
|
||||
} catch (Exception e) {
|
||||
@@ -75,10 +70,10 @@ public class ChannelInfo extends Info {
|
||||
return info;
|
||||
}
|
||||
|
||||
public String avatar_url = "";
|
||||
public String banner_url = "";
|
||||
public String feed_url = "";
|
||||
public List<InfoItem> related_streams = null;
|
||||
public String avatar_url;
|
||||
public String banner_url;
|
||||
public String feed_url;
|
||||
public List<InfoItem> related_streams;
|
||||
public long subscriber_count = -1;
|
||||
public boolean hasMoreStreams = false;
|
||||
public boolean has_more_streams = false;
|
||||
}
|
||||
|
||||
@@ -22,25 +22,14 @@ import org.schabi.newpipe.extractor.InfoItem;
|
||||
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
public class ChannelInfoItem implements InfoItem {
|
||||
public class ChannelInfoItem extends InfoItem {
|
||||
|
||||
public int serviceId = -1;
|
||||
public String channelName = "";
|
||||
public String thumbnailUrl = "";
|
||||
public String webPageUrl = "";
|
||||
public String description = "";
|
||||
public long subscriberCount = -1;
|
||||
public long viewCount = -1;
|
||||
public String thumbnail_url;
|
||||
public String description;
|
||||
public long subscriber_count = -1;
|
||||
public long view_count = -1;
|
||||
|
||||
public InfoType infoType() {
|
||||
return InfoType.CHANNEL;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return channelName;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return webPageUrl;
|
||||
public ChannelInfoItem() {
|
||||
super(InfoType.CHANNEL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,24 +31,24 @@ public class ChannelInfoItemCollector extends InfoItemCollector {
|
||||
public ChannelInfoItem extract(ChannelInfoItemExtractor extractor) throws ParsingException {
|
||||
ChannelInfoItem resultItem = new ChannelInfoItem();
|
||||
// important information
|
||||
resultItem.channelName = extractor.getChannelName();
|
||||
resultItem.name = extractor.getChannelName();
|
||||
|
||||
resultItem.serviceId = getServiceId();
|
||||
resultItem.webPageUrl = extractor.getWebPageUrl();
|
||||
resultItem.service_id = getServiceId();
|
||||
resultItem.url = extractor.getWebPageUrl();
|
||||
|
||||
// optional information
|
||||
try {
|
||||
resultItem.subscriberCount = extractor.getSubscriberCount();
|
||||
resultItem.subscriber_count = extractor.getSubscriberCount();
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
try {
|
||||
resultItem.viewCount = extractor.getViewCount();
|
||||
resultItem.view_count = extractor.getViewCount();
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
try {
|
||||
resultItem.thumbnailUrl = extractor.getThumbnailUrl();
|
||||
resultItem.thumbnail_url = extractor.getThumbnailUrl();
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user