From 36edf34793e2f5cfad0731d44cc3ef5b347a4719 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 29 Jul 2023 11:19:56 +0200 Subject: [PATCH] add visibility, license and tags to streams info --- src/main/java/me/kavin/piped/utils/CollectionUtils.java | 5 ++--- src/main/java/me/kavin/piped/utils/obj/Streams.java | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/CollectionUtils.java b/src/main/java/me/kavin/piped/utils/CollectionUtils.java index 0c46fdf..b04fa1d 100644 --- a/src/main/java/me/kavin/piped/utils/CollectionUtils.java +++ b/src/main/java/me/kavin/piped/utils/CollectionUtils.java @@ -4,7 +4,6 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; import me.kavin.piped.utils.obj.*; import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.channel.ChannelInfoItem; -import org.schabi.newpipe.extractor.channel.ChannelTabInfo; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import org.schabi.newpipe.extractor.linkhandler.ReadyChannelTabListLinkHandler; import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem; @@ -16,7 +15,6 @@ import java.util.List; import java.util.Locale; import java.util.Optional; -import static me.kavin.piped.consts.Constants.YOUTUBE_SERVICE; import static me.kavin.piped.utils.URLUtils.*; public class CollectionUtils { @@ -71,7 +69,8 @@ public class CollectionUtils { rewriteURL(info.getUploaderAvatarUrl()), rewriteURL(info.getThumbnailUrl()), info.getDuration(), info.getViewCount(), info.getLikeCount(), info.getDislikeCount(), info.getUploaderSubscriberCount(), info.isUploaderVerified(), audioStreams, videoStreams, relatedStreams, subtitles, livestream, rewriteVideoURL(info.getHlsUrl()), - rewriteVideoURL(info.getDashMpdUrl()), null, info.getCategory(), chapters, previewFrames); + rewriteVideoURL(info.getDashMpdUrl()), null, info.getCategory(), info.getLicence(), + info.getPrivacy().name().toLowerCase(), info.getTags(), chapters, previewFrames); } public static List collectRelatedItems(List items) { diff --git a/src/main/java/me/kavin/piped/utils/obj/Streams.java b/src/main/java/me/kavin/piped/utils/obj/Streams.java index 2567e89..f521b98 100644 --- a/src/main/java/me/kavin/piped/utils/obj/Streams.java +++ b/src/main/java/me/kavin/piped/utils/obj/Streams.java @@ -9,7 +9,9 @@ import java.util.List; public class Streams { public String title, description, uploadDate, uploader, uploaderUrl, uploaderAvatar, thumbnailUrl, hls, dash, - lbryId, category; + lbryId, category, license, visibility; + + public List tags; public boolean uploaderVerified; @@ -33,7 +35,7 @@ public class Streams { String uploaderAvatar, String thumbnailUrl, long duration, long views, long likes, long dislikes, long uploaderSubscriberCount, boolean uploaderVerified, List audioStreams, List videoStreams, List relatedStreams, List subtitles, boolean livestream, String hls, String dash, - String lbryId, String category, List chapters, List previewFrames) { + String lbryId, String category, String license, String visibility, List tags, List chapters, List previewFrames) { this.title = title; this.description = description; this.uploadDate = uploadDate; @@ -58,5 +60,8 @@ public class Streams { this.chapters = chapters; this.previewFrames = previewFrames; this.category = category; + this.license = license; + this.tags = tags; + this.visibility = visibility; } }