fix playlist banner foo

This commit is contained in:
Christian Schabesberger 2018-03-12 16:14:33 +01:00
parent b1130629bb
commit fce324d1bc
2 changed files with 4 additions and 15 deletions

View File

@ -74,21 +74,9 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
}
@Override
public String getBannerUrl() throws ParsingException {
try {
Element el = doc.select("div[id=\"gh-banner\"] style").first();
String cssContent = el.html();
String url = "https:" + Parser.matchGroup1("url\\((.*)\\)", cssContent);
if (url.contains("s.ytimg.com")) {
return null;
} else {
return url.substring(0, url.indexOf(");"));
}
} catch (Exception e) {
throw new ParsingException("Could not get playlist Banner");
}
public String getBannerUrl() {
return ""; // Banner can't be handled by frontend right now.
// Whoever is willing to implement this should also implement this in the fornt end
}
@Override

View File

@ -55,6 +55,7 @@ public class YoutubePlaylistExtractorTest {
@Test
public void testGetBannerUrl() throws Exception {
System.out.println(extractor.getBannerUrl());
assertTrue(extractor.getBannerUrl(), extractor.getBannerUrl().contains("yt"));
}