Update NewPipeExtractor and extract more info.

This commit is contained in:
FireMasterK 2021-09-03 22:01:26 +05:30
parent f4b0884978
commit b2c9ffa789
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
4 changed files with 25 additions and 13 deletions

View file

@ -16,7 +16,7 @@ dependencies {
implementation 'it.unimi.dsi:fastutil-core:8.5.4' implementation 'it.unimi.dsi:fastutil-core:8.5.4'
implementation 'commons-codec:commons-codec:1.15' implementation 'commons-codec:commons-codec:1.15'
implementation 'org.bouncycastle:bcprov-jdk15on:1.69' implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:d8179dc35ae036bfd6e450a7050e998e0f1b041f' implementation 'com.github.TeamNewPipe:NewPipeExtractor:f0aa46b008f2256b3e86a2182d53854fce1f8cb7'
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.5' implementation 'com.fasterxml.jackson.core:jackson-core:2.12.5'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.5' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.5'

View file

@ -176,7 +176,8 @@ public class ResponseHelper {
StreamInfoItem item = (StreamInfoItem) o; StreamInfoItem item = (StreamInfoItem) o;
relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(),
rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23),
item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(),
item.getViewCount(), item.isUploaderVerified()));
}); });
List<ChapterSegment> segments = new ObjectArrayList<>(); List<ChapterSegment> segments = new ObjectArrayList<>();
@ -193,8 +194,9 @@ public class ResponseHelper {
final Streams streams = new Streams(info.getName(), info.getDescription().getContent(), final Streams streams = new Streams(info.getName(), info.getDescription().getContent(),
info.getTextualUploadDate(), info.getUploaderName(), info.getUploaderUrl().substring(23), info.getTextualUploadDate(), info.getUploaderName(), info.getUploaderUrl().substring(23),
rewriteURL(info.getUploaderAvatarUrl()), rewriteURL(info.getThumbnailUrl()), info.getDuration(), rewriteURL(info.getUploaderAvatarUrl()), rewriteURL(info.getThumbnailUrl()), info.getDuration(),
info.getViewCount(), info.getLikeCount(), info.getDislikeCount(), audioStreams, videoStreams, info.getViewCount(), info.getLikeCount(), info.getDislikeCount(), info.isUploaderVerified(),
relatedStreams, subtitles, livestream, hls, info.getDashMpdUrl(), futureLbryId.get()); audioStreams, videoStreams, relatedStreams, subtitles, livestream, hls, info.getDashMpdUrl(),
futureLbryId.get());
return Constants.mapper.writeValueAsBytes(streams); return Constants.mapper.writeValueAsBytes(streams);
@ -210,7 +212,8 @@ public class ResponseHelper {
StreamInfoItem item = o; StreamInfoItem item = o;
relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(),
rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23),
item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(),
item.getViewCount(), item.isUploaderVerified()));
}); });
Multithreading.runAsync(() -> { Multithreading.runAsync(() -> {
@ -269,7 +272,8 @@ public class ResponseHelper {
StreamInfoItem item = o; StreamInfoItem item = o;
relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(),
rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23),
item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(),
item.getViewCount(), item.isUploaderVerified()));
}); });
String nextpage = null; String nextpage = null;
@ -302,7 +306,8 @@ public class ResponseHelper {
StreamInfoItem item = o; StreamInfoItem item = o;
relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(),
rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23),
item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(),
item.getViewCount(), item.isUploaderVerified()));
}); });
return Constants.mapper.writeValueAsBytes(relatedStreams); return Constants.mapper.writeValueAsBytes(relatedStreams);
@ -319,7 +324,8 @@ public class ResponseHelper {
StreamInfoItem item = o; StreamInfoItem item = o;
relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(),
rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23),
item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(),
item.getViewCount(), item.isUploaderVerified()));
}); });
String nextpage = null; String nextpage = null;
@ -352,7 +358,8 @@ public class ResponseHelper {
StreamInfoItem item = o; StreamInfoItem item = o;
relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(),
rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23),
item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(),
item.getViewCount(), item.isUploaderVerified()));
}); });
String nextpage = null; String nextpage = null;

View file

@ -2,17 +2,18 @@ package me.kavin.piped.utils.obj;
public class StreamItem { public class StreamItem {
public String url, title, thumbnail, uploaderName, uploaderUrl, uploadedDate; public String url, title, thumbnail, uploaderName, uploaderUrl, uploaderAvatarUrl, uploadedDate;
public long duration, views; public long duration, views;
public boolean uploaderVerified; public boolean uploaderVerified;
public StreamItem(String url, String title, String thumbnail, String uploaderName, String uploaderUrl, public StreamItem(String url, String title, String thumbnail, String uploaderName, String uploaderUrl,
String uploadedDate, long duration, long views, boolean uploaderVerified) { String uploaderAvatarUrl, String uploadedDate, long duration, long views, boolean uploaderVerified) {
this.url = url; this.url = url;
this.title = title; this.title = title;
this.thumbnail = thumbnail; this.thumbnail = thumbnail;
this.uploaderName = uploaderName; this.uploaderName = uploaderName;
this.uploaderUrl = uploaderUrl; this.uploaderUrl = uploaderUrl;
this.uploaderAvatarUrl = uploaderAvatarUrl;
this.uploadedDate = uploadedDate; this.uploadedDate = uploadedDate;
this.duration = duration; this.duration = duration;
this.views = views; this.views = views;

View file

@ -9,6 +9,8 @@ public class Streams {
public String title, description, uploadDate, uploader, uploaderUrl, uploaderAvatar, thumbnailUrl, hls, dash, public String title, description, uploadDate, uploader, uploaderUrl, uploaderAvatar, thumbnailUrl, hls, dash,
lbryId; lbryId;
public boolean uploaderVerified;
public long duration, views, likes, dislikes; public long duration, views, likes, dislikes;
public List<PipedStream> audioStreams, videoStreams; public List<PipedStream> audioStreams, videoStreams;
@ -23,8 +25,9 @@ public class Streams {
public Streams(String title, String description, String uploadDate, String uploader, String uploaderUrl, public Streams(String title, String description, String uploadDate, String uploader, String uploaderUrl,
String uploaderAvatar, String thumbnailUrl, long duration, long views, long likes, long dislikes, String uploaderAvatar, String thumbnailUrl, long duration, long views, long likes, long dislikes,
List<PipedStream> audioStreams, List<PipedStream> videoStreams, List<StreamItem> relatedStreams, boolean uploaderVerified, List<PipedStream> audioStreams, List<PipedStream> videoStreams,
List<Subtitle> subtitles, boolean livestream, String hls, String dash, String lbryId) { List<StreamItem> relatedStreams, List<Subtitle> subtitles, boolean livestream, String hls, String dash,
String lbryId) {
this.title = title; this.title = title;
this.description = description; this.description = description;
this.uploadDate = uploadDate; this.uploadDate = uploadDate;
@ -36,6 +39,7 @@ public class Streams {
this.views = views; this.views = views;
this.likes = likes; this.likes = likes;
this.dislikes = dislikes; this.dislikes = dislikes;
this.uploaderVerified = uploaderVerified;
this.audioStreams = audioStreams; this.audioStreams = audioStreams;
this.videoStreams = videoStreams; this.videoStreams = videoStreams;
this.relatedStreams = relatedStreams; this.relatedStreams = relatedStreams;