From 7dcc9f159bb7280fd97f48af42cf5c2b3c182e27 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Mon, 17 Feb 2020 11:41:11 +0100 Subject: [PATCH] Stream: fix uploader avatar url --- .../youtube/extractors/YoutubeStreamExtractor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index 65946436c..b60fa8751 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -476,9 +476,11 @@ public class YoutubeStreamExtractor extends StreamExtractor { String uploaderAvatarUrl = null; try { - uploaderAvatarUrl = doc.select("a[class*=\"yt-user-photo\"]").first() - .select("img").first() - .attr("abs:data-thumb"); + uploaderAvatarUrl = ytInitialData.getObject("contents").getObject("twoColumnWatchNextResults").getObject("secondaryResults") + .getObject("secondaryResults").getArray("results").getObject(0).getObject("compactAutoplayRenderer") + .getArray("contents").getObject(0).getObject("compactVideoRenderer").getObject("channelThumbnail") + .getArray("thumbnails").getObject(0).getString("url"); + } catch (Exception e) {//todo: add fallback method throw new ParsingException("Could not get uploader avatar url", e); }