From d4e975e4fa470eb2e4fa4e80bb023f85d6cf6b1a Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 16 Aug 2019 22:47:02 +0200 Subject: [PATCH] Fix search error with some playlists Somtimes there were two divs with class "yt-lockup-meta", so the extractor couldn't get the correct one. --- .../extractors/YoutubePlaylistInfoItemExtractor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistInfoItemExtractor.java index 2d084909b..8812391f8 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistInfoItemExtractor.java @@ -49,10 +49,11 @@ public class YoutubePlaylistInfoItemExtractor implements PlaylistInfoItemExtract @Override public String getUrl() throws ParsingException { try { - final Element div = el.select("div[class=\"yt-lockup-meta\"]").first(); + final Element a = el.select("div[class=\"yt-lockup-meta\"]") + .select("ul[class=\"yt-lockup-meta-info\"]") + .select("li").select("a").first(); - if(div != null) { - final Element a = div.select("a").first(); + if(a != null) { return a.attr("abs:href"); }