fix could not parese metadata despide available error

This commit is contained in:
Christian Schabesberger 2018-05-04 16:11:25 +02:00
parent d3c0b793b3
commit 41751543d0
2 changed files with 5 additions and 0 deletions

View File

@ -135,7 +135,11 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
Element meta = item.select("div[class=\"yt-lockup-meta\"]").first();
if (meta == null) return -1;
// This case can happen if google releases a special video
if(meta.select("li").size() < 2) return -1;
input = meta.select("li").get(1).text();
} catch (IndexOutOfBoundsException e) {
throw new ParsingException("Could not parse yt-lockup-meta although available: " + getUrl(), e);
}

View File

@ -48,6 +48,7 @@ public class YoutubeTrendingExtractorTest {
.getKioskList()
.getExtractorById("Trending", null);
extractor.fetchPage();
extractor.setContentCountry("de");
}
@Test