Skip to content

Commit

Permalink
add visibility, license and tags to streams info
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Jul 29, 2023
1 parent 75883f6 commit 36edf34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
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;
}
}

0 comments on commit 36edf34

Please sign in to comment.