fix: support new PlaylistInfoItem interface
This commit is contained in:
parent
73c182f817
commit
abf04733a3
|
@ -6,9 +6,12 @@ import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemExtractor;
|
|||
|
||||
public class BandcampAlbumInfoItemExtractor implements PlaylistInfoItemExtractor {
|
||||
private final JsonObject albumInfoItem;
|
||||
private final String uploaderUrl;
|
||||
|
||||
public BandcampAlbumInfoItemExtractor(final JsonObject albumInfoItem) {
|
||||
public BandcampAlbumInfoItemExtractor(final JsonObject albumInfoItem,
|
||||
final String uploaderUrl) {
|
||||
this.albumInfoItem = albumInfoItem;
|
||||
this.uploaderUrl = uploaderUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +40,17 @@ public class BandcampAlbumInfoItemExtractor implements PlaylistInfoItemExtractor
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getStreamCount() throws ParsingException {
|
||||
public String getUploaderUrl() {
|
||||
return uploaderUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUploaderVerified() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStreamCount() {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,8 @@ public class BandcampChannelTabExtractor extends ChannelTabExtractor {
|
|||
final JsonObject discograph = discography.getObject(i);
|
||||
|
||||
if (discograph.getString("item_type").equals("album")) {
|
||||
collector.commit(new BandcampAlbumInfoItemExtractor(discograph));
|
||||
collector.commit(new BandcampAlbumInfoItemExtractor(
|
||||
discograph, getBaseUrl()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,17 @@ public class PeertubePlaylistInfoItemExtractor implements PlaylistInfoItemExtrac
|
|||
return JsonUtils.getString(owner, "displayName");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUploaderUrl() throws ParsingException {
|
||||
final JsonObject owner = JsonUtils.getObject(item, "ownerAccount");
|
||||
return JsonUtils.getString(owner, "url");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUploaderVerified() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStreamCount() throws ParsingException {
|
||||
return JsonUtils.getNumber(item, "videosLength").longValue();
|
||||
|
|
Loading…
Reference in New Issue