Fixed hentai2read ripper

This commit is contained in:
cyian-1756 2018-05-11 23:56:02 -04:00
parent 19e4a95c96
commit 03963eac55

View File

@ -44,21 +44,16 @@ public class Hentai2readRipper extends AbstractHTMLRipper {
@Override
public Document getFirstPage() throws IOException {
try {
Document tempDoc;
// get the first page of the comic
if (url.toExternalForm().substring(url.toExternalForm().length() - 1).equals("/")) {
tempDoc = Http.url(url + "1").get();
} else {
tempDoc = Http.url(url + "/1").get();
}
for (Element el : tempDoc.select("ul.nav > li > a")) {
if (el.attr("href").startsWith("https://hentai2read.com/thumbnails/")) {
// Get the page with the thumbnails
return Http.url(el.attr("href")).get();
}
}
tempDoc = Http.url(url).get();
// Get the thumbnail page so we can rip all images without loading every page in the comic
String thumbnailLink = tempDoc.select("a[data-original-title=Thumbnails").attr("href");
return Http.url(thumbnailLink).get();
} catch (IOException e) {
throw new IOException("Unable to get first page");
}
}
@Override
public String getAlbumTitle(URL url) throws MalformedURLException {