From 951ed9f0d85b5a526b40d5883c676fb8069ea312 Mon Sep 17 00:00:00 2001 From: wb9688 Date: Thu, 27 Feb 2020 09:27:56 +0100 Subject: [PATCH] Don't call getUploaderInfo() in onFetchPage() for playlists This way YouTube Music playlists will keep working in NewPipe --- .../youtube/extractors/YoutubePlaylistExtractor.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistExtractor.java index 84af2146d..240fa537f 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistExtractor.java @@ -28,7 +28,6 @@ import javax.annotation.Nonnull; @SuppressWarnings("WeakerAccess") public class YoutubePlaylistExtractor extends PlaylistExtractor { private JsonObject initialData; - private JsonObject uploaderInfo; private JsonObject playlistInfo; public YoutubePlaylistExtractor(StreamingService service, ListLinkHandler linkHandler) { @@ -57,7 +56,6 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor { } initialData = ajaxJson.getObject(1).getObject("response"); - uploaderInfo = getUploaderInfo(); playlistInfo = getPlaylistInfo(); } @@ -140,7 +138,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor { public String getUploaderUrl() throws ParsingException { try { return YoutubeChannelExtractor.CHANNEL_URL_BASE + - uploaderInfo.getObject("navigationEndpoint").getObject("browseEndpoint").getString("browseId"); + getUploaderInfo().getObject("navigationEndpoint").getObject("browseEndpoint").getString("browseId"); } catch (Exception e) { throw new ParsingException("Could not get playlist uploader url", e); } @@ -149,7 +147,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor { @Override public String getUploaderName() throws ParsingException { try { - return uploaderInfo.getObject("title").getArray("runs").getObject(0).getString("text"); + return getUploaderInfo().getObject("title").getArray("runs").getObject(0).getString("text"); } catch (Exception e) { throw new ParsingException("Could not get playlist uploader name", e); } @@ -158,7 +156,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor { @Override public String getUploaderAvatarUrl() throws ParsingException { try { - return uploaderInfo.getObject("thumbnail").getArray("thumbnails").getObject(0).getString("url"); + return getUploaderInfo().getObject("thumbnail").getArray("thumbnails").getObject(0).getString("url"); } catch (Exception e) { throw new ParsingException("Could not get playlist uploader avatar", e); }