Implement support for extracting playlist description.

This commit is contained in:
Kavin 2023-05-14 21:17:16 +01:00
parent 0769fb6358
commit f6639511aa
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
3 changed files with 5 additions and 4 deletions

View File

@ -61,7 +61,7 @@ public class PlaylistHandlers {
}
final Playlist playlist = new Playlist(info.getName(), rewriteURL(info.getThumbnailUrl()),
rewriteURL(info.getBannerUrl()), nextpage,
info.getDescription().getContent(), rewriteURL(info.getBannerUrl()), nextpage,
info.getUploaderName().isEmpty() ? null : info.getUploaderName(),
substringYouTube(info.getUploaderUrl()), rewriteURL(info.getUploaderAvatarUrl()),
(int) info.getStreamCount(), relatedStreams);

View File

@ -67,7 +67,7 @@ public class AuthPlaylistHandlers {
video.getDuration(), -1, -1, channel.isVerified(), false));
}
final Playlist playlist = new Playlist(pl.getName(), rewriteURL(pl.getThumbnail()), null, null, pl.getOwner().getUsername(),
final Playlist playlist = new Playlist(pl.getName(), rewriteURL(pl.getThumbnail()), pl.getShortDescription(), null, null, pl.getOwner().getUsername(),
null, null, videos.size(), relatedStreams);
return mapper.writeValueAsBytes(playlist);

View File

@ -4,14 +4,15 @@ import java.util.List;
public class Playlist {
public String name, thumbnailUrl, bannerUrl, nextpage, uploader, uploaderUrl, uploaderAvatar;
public String name, thumbnailUrl, description, bannerUrl, nextpage, uploader, uploaderUrl, uploaderAvatar;
public int videos;
public List<ContentItem> relatedStreams;
public Playlist(String name, String thumbnailUrl, String bannerUrl, String nextpage, String uploader,
public Playlist(String name, String thumbnailUrl, String description, String bannerUrl, String nextpage, String uploader,
String uploaderUrl, String uploaderAvatar, int videos, List<ContentItem> relatedStreams) {
this.name = name;
this.thumbnailUrl = thumbnailUrl;
this.description = description;
this.bannerUrl = bannerUrl;
this.nextpage = nextpage;
this.videos = videos;