Merge branch 'dev' of github.com:TeamNewPipe/NewPipeExtractor into channel-tabs

This commit is contained in:
ThetaDev 2023-04-05 14:52:18 +02:00
commit e57d43f92d
3 changed files with 21 additions and 6 deletions

View File

@ -8,7 +8,7 @@ allprojects {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
version 'v0.22.5'
version 'v0.22.6'
group 'com.github.TeamNewPipe'
repositories {

View File

@ -25,7 +25,7 @@ public class BandcampRelatedPlaylistInfoItemExtractor implements PlaylistInfoIte
@Override
public String getUrl() throws ParsingException {
return relatedAlbum.getElementsByClass("title-and-artist").attr("abs:href");
return relatedAlbum.getElementsByClass("album-link").attr("abs:href");
}
@Override

View File

@ -66,10 +66,15 @@ public class YoutubeCommentsExtractor extends CommentsExtractor {
* @return the continuation token or null if none was found
*/
@Nullable
private String findInitialCommentsToken(final JsonObject nextResponse)
throws ExtractionException {
final String token = JsonUtils.getArray(nextResponse,
"contents.twoColumnWatchNextResults.results.results.contents")
private String findInitialCommentsToken(final JsonObject nextResponse) {
final JsonArray contents = getJsonContents(nextResponse);
// For videos where comments are unavailable, this would be null
if (contents == null) {
return null;
}
final String token = contents
.stream()
// Only use JsonObjects
.filter(JsonObject.class::isInstance)
@ -105,6 +110,16 @@ public class YoutubeCommentsExtractor extends CommentsExtractor {
return token;
}
@Nullable
private JsonArray getJsonContents(final JsonObject nextResponse) {
try {
return JsonUtils.getArray(nextResponse,
"contents.twoColumnWatchNextResults.results.results.contents");
} catch (final ParsingException e) {
return null;
}
}
@Nonnull
private InfoItemsPage<CommentsInfoItem> getInfoItemsPageForDisabledComments() {
return new InfoItemsPage<>(Collections.emptyList(), null, Collections.emptyList());