add getSubChannel Name, Url and AvatarUrl for playlists
This commit is contained in:
parent
cf99107745
commit
1a6e92ebf6
|
@ -6,6 +6,8 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
|||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class PlaylistExtractor extends ListExtractor<StreamInfoItem> {
|
||||
|
||||
public PlaylistExtractor(StreamingService service, ListLinkHandler linkHandler) {
|
||||
|
@ -20,4 +22,9 @@ public abstract class PlaylistExtractor extends ListExtractor<StreamInfoItem> {
|
|||
public abstract String getUploaderAvatarUrl() throws ParsingException;
|
||||
|
||||
public abstract long getStreamCount() throws ParsingException;
|
||||
|
||||
@Nonnull public abstract String getSubChannelName() throws ParsingException;
|
||||
@Nonnull public abstract String getSubChannelUrl() throws ParsingException;
|
||||
@Nonnull public abstract String getSubChannelAvatarUrl() throws ParsingException;
|
||||
|
||||
}
|
||||
|
|
|
@ -63,6 +63,24 @@ public class PeertubePlaylistExtractor extends PlaylistExtractor {
|
|||
return playlistInfo.getNumber("videosLength").longValue();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelName() throws ParsingException {
|
||||
return playlistInfo.getObject("videoChannel").getString("displayName");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelUrl() throws ParsingException {
|
||||
return playlistInfo.getObject("videoChannel").getString("url");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelAvatarUrl() throws ParsingException {
|
||||
return getBaseUrl() + playlistInfo.getObject("videoChannel").getObject("avatar").getString("path");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException {
|
||||
|
|
|
@ -114,6 +114,24 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
|
|||
return playlist.getNumber("track_count", 0).longValue();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelName() throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelUrl() throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelAvatarUrl() throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException {
|
||||
|
|
|
@ -149,6 +149,24 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
|||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelName() throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelUrl() throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSubChannelAvatarUrl() throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public InfoItemsPage<StreamInfoItem> getInitialPage() {
|
||||
|
|
Loading…
Reference in New Issue