Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add visibility, license and tags to streams info #661

Merged
merged 1 commit into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/main/java/me/kavin/piped/utils/CollectionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
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;
Expand All @@ -16,7 +15,6 @@
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 {
Expand Down Expand Up @@ -71,7 +69,8 @@ public static Streams collectStreamInfo(StreamInfo info) {
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<ContentItem> collectRelatedItems(List<? extends InfoItem> items) {
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/me/kavin/piped/utils/obj/Streams.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
public class Streams {

public String title, description, uploadDate, uploader, uploaderUrl, uploaderAvatar, thumbnailUrl, hls, dash,
lbryId, category;
lbryId, category, license, visibility;

public List<String> tags;

public boolean uploaderVerified;

Expand All @@ -33,7 +35,7 @@ public Streams(String title, String description, String uploadDate, String uploa
String uploaderAvatar, String thumbnailUrl, long duration, long views, long likes, long dislikes, long uploaderSubscriberCount,
boolean uploaderVerified, List<PipedStream> audioStreams, List<PipedStream> videoStreams,
List<ContentItem> relatedStreams, List<Subtitle> subtitles, boolean livestream, String hls, String dash,
String lbryId, String category, List<ChapterSegment> chapters, List<PreviewFrames> previewFrames) {
String lbryId, String category, String license, String visibility, List<String> tags, List<ChapterSegment> chapters, List<PreviewFrames> previewFrames) {
this.title = title;
this.description = description;
this.uploadDate = uploadDate;
Expand All @@ -58,5 +60,8 @@ public Streams(String title, String description, String uploadDate, String uploa
this.chapters = chapters;
this.previewFrames = previewFrames;
this.category = category;
this.license = license;
this.tags = tags;
this.visibility = visibility;
}
}