fix playlist banner foo
This commit is contained in:
parent
b1130629bb
commit
fce324d1bc
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue