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.
This commit is contained in:
Stypox 2019-08-16 22:47:02 +02:00
parent 5f65788a2f
commit d4e975e4fa
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 4 additions and 3 deletions

View File

@ -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");
}