diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java index db0333647..d5587ec4e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java @@ -1,6 +1,27 @@ +/* + * Created by Christian Schabesberger on 25.07.16. + * + * Copyright (C) Christian Schabesberger 2016 + * ChannelExtractor.java is part of NewPipe Extractor. + * + * NewPipe Extractor is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * NewPipe Extractor is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NewPipe Extractor. If not, see . + */ + package org.schabi.newpipe.extractor.channel; import org.schabi.newpipe.extractor.Extractor; +import org.schabi.newpipe.extractor.Image; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; @@ -8,26 +29,6 @@ import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import javax.annotation.Nonnull; import java.util.List; -/* - * Created by Christian Schabesberger on 25.07.16. - * - * Copyright (C) Christian Schabesberger 2016 - * ChannelExtractor.java is part of NewPipe. - * - * NewPipe is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * NewPipe is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with NewPipe. If not, see . - */ - public abstract class ChannelExtractor extends Extractor { public static final long UNKNOWN_SUBSCRIBER_COUNT = -1; @@ -36,14 +37,17 @@ public abstract class ChannelExtractor extends Extractor { super(service, linkHandler); } - public abstract String getAvatarUrl() throws ParsingException; - public abstract String getBannerUrl() throws ParsingException; + @Nonnull + public abstract List getAvatars() throws ParsingException; + @Nonnull + public abstract List getBanners() throws ParsingException; public abstract String getFeedUrl() throws ParsingException; public abstract long getSubscriberCount() throws ParsingException; public abstract String getDescription() throws ParsingException; public abstract String getParentChannelName() throws ParsingException; public abstract String getParentChannelUrl() throws ParsingException; - public abstract String getParentChannelAvatarUrl() throws ParsingException; + @Nonnull + public abstract List getParentChannelAvatars() throws ParsingException; public abstract boolean isVerified() throws ParsingException; @Nonnull public abstract List getTabs() throws ParsingException; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java index bc4eee467..a714deadb 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java @@ -1,5 +1,6 @@ package org.schabi.newpipe.extractor.playlist; +import org.schabi.newpipe.extractor.Image; import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ParsingException; @@ -9,6 +10,9 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem; import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; + public abstract class PlaylistExtractor extends ListExtractor { public PlaylistExtractor(final StreamingService service, final ListLinkHandler linkHandler) { @@ -17,7 +21,8 @@ public abstract class PlaylistExtractor extends ListExtractor { public abstract String getUploaderUrl() throws ParsingException; public abstract String getUploaderName() throws ParsingException; - public abstract String getUploaderAvatarUrl() throws ParsingException; + @Nonnull + public abstract List getUploaderAvatars() throws ParsingException; public abstract boolean isUploaderVerified() throws ParsingException; public abstract long getStreamCount() throws ParsingException; @@ -26,15 +31,13 @@ public abstract class PlaylistExtractor extends ListExtractor { public abstract Description getDescription() throws ParsingException; @Nonnull - public String getThumbnailUrl() throws ParsingException { - return ""; + public List getThumbnails() throws ParsingException { + return Collections.emptyList(); } @Nonnull - public String getBannerUrl() throws ParsingException { - // Banner can't be handled by frontend right now. - // Whoever is willing to implement this should also implement it in the frontend. - return ""; + public List getBanners() throws ParsingException { + return List.of(); } @Nonnull @@ -48,8 +51,8 @@ public abstract class PlaylistExtractor extends ListExtractor { } @Nonnull - public String getSubChannelAvatarUrl() throws ParsingException { - return ""; + public List getSubChannelAvatars() throws ParsingException { + return List.of(); } public PlaylistInfo.PlaylistType getPlaylistType() throws ParsingException { diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java index 6fbcf8fbb..f974cade0 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java @@ -1,25 +1,26 @@ -package org.schabi.newpipe.extractor.stream; - /* * Created by Christian Schabesberger on 10.08.18. * * Copyright (C) Christian Schabesberger 2016 - * StreamExtractor.java is part of NewPipe. + * StreamExtractor.java is part of NewPipe Extractor. * - * NewPipe is free software: you can redistribute it and/or modify + * NewPipe Extractor is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * NewPipe is distributed in the hope that it will be useful, + * NewPipe Extractor is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with NewPipe. If not, see . + * along with NewPipe Extractor. If not, see . */ +package org.schabi.newpipe.extractor.stream; + +import org.schabi.newpipe.extractor.Image; import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.InfoItemsCollector; import org.schabi.newpipe.extractor.InfoItemExtractor; @@ -87,13 +88,12 @@ public abstract class StreamExtractor extends Extractor { } /** - * This will return the url to the thumbnail of the stream. Try to return the medium resolution - * here. + * This will return the thumbnails of the stream. * - * @return The url of the thumbnail. + * @return the thumbnails of the stream */ @Nonnull - public abstract String getThumbnailUrl() throws ParsingException; + public abstract List getThumbnails() throws ParsingException; /** * This is the stream description. @@ -208,14 +208,18 @@ public abstract class StreamExtractor extends Extractor { } /** - * The url to the image file/profile picture/avatar of the creator/uploader of the stream. - * If the url is not available you can return an empty String. + * The image files/profile pictures/avatars of the creator/uploader of the stream. * - * @return The url of the image file of the uploader or an empty String + *

+ * If they are not available in the stream on specific cases, you must return an empty list for + * these ones, like it is made by default. + *

+ * + * @return the avatars of the sub-channel of the stream or an empty list (default) */ @Nonnull - public String getUploaderAvatarUrl() throws ParsingException { - return ""; + public List getUploaderAvatars() throws ParsingException { + return List.of(); } /** @@ -243,14 +247,23 @@ public abstract class StreamExtractor extends Extractor { } /** - * The url to the image file/profile picture/avatar of the sub-channel of the stream. - * If the url is not available you can return an empty String. + * The avatars of the sub-channel of the stream. * - * @return The url of the image file of the sub-channel or an empty String + *

+ * If they are not available in the stream on specific cases, you must return an empty list for + * these ones, like it is made by default. + *

+ * + *

+ * If the concept of sub-channels doesn't apply to the stream's service, keep the default + * implementation. + *

+ * + * @return the avatars of the sub-channel of the stream or an empty list (default) */ @Nonnull - public String getSubChannelAvatarUrl() throws ParsingException { - return ""; + public List getSubChannelAvatars() throws ParsingException { + return List.of(); } /**