From bbee15474d64b7994493d477c5cc236428308d5b Mon Sep 17 00:00:00 2001 From: TobiGr Date: Thu, 25 Mar 2021 19:10:11 +0100 Subject: [PATCH] [PeerTube] Fix playlist extraction --- .../services/peertube/PeertubeParsingHelper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeParsingHelper.java index 96d7d566c..b324cb1af 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeParsingHelper.java @@ -86,7 +86,13 @@ public class PeertubeParsingHelper { for (final Object c : contents) { if (c instanceof JsonObject) { - final JsonObject item = (JsonObject) c; + JsonObject item = (JsonObject) c; + + // PeerTube playlists have the stream info encapsulated in an "video" object + if (item.has("video")) { + item = item.getObject("video"); + } + PeertubeStreamInfoItemExtractor extractor; if (sepia) { extractor = new PeertubeSepiaStreamInfoItemExtractor(item, baseUrl);