Fix dash parser and more refactor
- Add new itags
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.schabi.newpipe.extractor.playlist;
|
||||
|
||||
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;
|
||||
|
||||
@@ -14,14 +14,10 @@ public class PlaylistInfo extends Info {
|
||||
|
||||
info.service_id = extractor.getServiceId();
|
||||
info.url = extractor.getUrl();
|
||||
info.id = extractor.getPlaylistId();
|
||||
info.name = extractor.getPlaylistName();
|
||||
info.hasMoreStreams = extractor.hasMoreStreams();
|
||||
info.has_more_streams = extractor.hasMoreStreams();
|
||||
|
||||
try {
|
||||
info.id = extractor.getPlaylistId();
|
||||
} catch (Exception e) {
|
||||
info.errors.add(e);
|
||||
}
|
||||
try {
|
||||
info.streams_count = extractor.getStreamsCount();
|
||||
} catch (Exception e) {
|
||||
@@ -63,12 +59,12 @@ public class PlaylistInfo extends Info {
|
||||
return info;
|
||||
}
|
||||
|
||||
public String avatar_url = "";
|
||||
public String banner_url = "";
|
||||
public String uploader_url = "";
|
||||
public String uploader_name = "";
|
||||
public String uploader_avatar_url = "";
|
||||
public String avatar_url;
|
||||
public String banner_url;
|
||||
public String uploader_url;
|
||||
public String uploader_name;
|
||||
public String uploader_avatar_url;
|
||||
public long streams_count = 0;
|
||||
public List<InfoItem> related_streams = null;
|
||||
public boolean hasMoreStreams = false;
|
||||
public List<InfoItem> related_streams;
|
||||
public boolean has_more_streams;
|
||||
}
|
||||
|
||||
@@ -2,22 +2,15 @@ package org.schabi.newpipe.extractor.playlist;
|
||||
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
|
||||
public class PlaylistInfoItem implements InfoItem {
|
||||
public class PlaylistInfoItem extends InfoItem {
|
||||
|
||||
public int serviceId = -1;
|
||||
public String name = "";
|
||||
public String thumbnailUrl = "";
|
||||
public String webPageUrl = "";
|
||||
public String thumbnail_url;
|
||||
/**
|
||||
* How many streams this playlist have
|
||||
*/
|
||||
public long streams_count = 0;
|
||||
|
||||
public InfoType infoType() {
|
||||
return InfoType.PLAYLIST;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return webPageUrl;
|
||||
public PlaylistInfoItem() {
|
||||
super(InfoType.PLAYLIST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.schabi.newpipe.extractor.playlist;
|
||||
|
||||
import org.schabi.newpipe.extractor.InfoItemCollector;
|
||||
import org.schabi.newpipe.extractor.UrlIdHandler;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
public class PlaylistInfoItemCollector extends InfoItemCollector {
|
||||
@@ -12,10 +13,16 @@ public class PlaylistInfoItemCollector extends InfoItemCollector {
|
||||
final PlaylistInfoItem resultItem = new PlaylistInfoItem();
|
||||
|
||||
resultItem.name = extractor.getPlaylistName();
|
||||
resultItem.serviceId = getServiceId();
|
||||
resultItem.webPageUrl = extractor.getWebPageUrl();
|
||||
resultItem.service_id = getServiceId();
|
||||
resultItem.url = extractor.getWebPageUrl();
|
||||
|
||||
try {
|
||||
resultItem.thumbnailUrl = extractor.getThumbnailUrl();
|
||||
resultItem.thumbnail_url = extractor.getThumbnailUrl();
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
try {
|
||||
resultItem.streams_count = extractor.getStreamsCount();
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
|
||||
@@ -6,4 +6,5 @@ public interface PlaylistInfoItemExtractor {
|
||||
String getThumbnailUrl() throws ParsingException;
|
||||
String getPlaylistName() throws ParsingException;
|
||||
String getWebPageUrl() throws ParsingException;
|
||||
long getStreamsCount() throws ParsingException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user