Bandcmap channel extractor: fix getting banner url
This commit is contained in:
parent
7730eb2ea1
commit
d5cdc20be1
|
@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp.extractors;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.Jsoup;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||||
|
@ -74,8 +74,10 @@ public class BandcampChannelExtractor extends ChannelExtractor {
|
||||||
String html = getDownloader().get(channelInfo.getString("bandcamp_url").replace("http://", "https://"))
|
String html = getDownloader().get(channelInfo.getString("bandcamp_url").replace("http://", "https://"))
|
||||||
.responseBody();
|
.responseBody();
|
||||||
|
|
||||||
return new Document(html).getElementById("customHeader")
|
return Jsoup.parse(html)
|
||||||
|
.getElementById("customHeader")
|
||||||
.getElementsByTag("img")
|
.getElementsByTag("img")
|
||||||
|
.first()
|
||||||
.attr("src");
|
.attr("src");
|
||||||
|
|
||||||
} catch (IOException | ReCaptchaException e) {
|
} catch (IOException | ReCaptchaException e) {
|
||||||
|
|
|
@ -39,4 +39,10 @@ public class BandcampChannelExtractorTest {
|
||||||
public void testLength() throws ParsingException {
|
public void testLength() throws ParsingException {
|
||||||
assertTrue(extractor.getInitialPage().getItems().size() > 2);
|
assertTrue(extractor.getInitialPage().getItems().size() > 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetBannerUrl() throws ParsingException {
|
||||||
|
// Why is this picture in png format when all other pictures are jpg?
|
||||||
|
assertTrue(extractor.getBannerUrl().endsWith(".png"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue