From 68a3948af6dbd5795c061ff874df67ed1d19cb78 Mon Sep 17 00:00:00 2001 From: Xiang Rong Lin <41164160+XiangRongLin@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:54:17 +0100 Subject: [PATCH] [Youtube] Fix get banner url --- .../youtube/extractors/YoutubeMixPlaylistExtractor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java index af200a9a8..6687eb844 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java @@ -60,7 +60,9 @@ public class YoutubeMixPlaylistExtractor extends PlaylistExtractor { @Override public String getThumbnailUrl() throws ParsingException { try { - final String videoId = playlistData.getArray("contents").getObject(0).getString("videoId"); + final String videoId = playlistData.getArray("contents").getObject(0) + .getObject("playlistPanelVideoRenderer").getString("videoId"); + if (videoId == null || videoId.isEmpty()) throw new ParsingException(""); return getThumbnailUrlFromId(videoId); } catch (Exception e) { throw new ParsingException("Could not get playlist thumbnail", e);