Merge pull request #576 from cyian-1756/hentai2readFixes
Fixed hentai2read ripper
This commit is contained in:
commit
5fc79eb658
@ -44,21 +44,16 @@ public class Hentai2readRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getFirstPage() throws IOException {
|
public Document getFirstPage() throws IOException {
|
||||||
|
try {
|
||||||
Document tempDoc;
|
Document tempDoc;
|
||||||
// get the first page of the comic
|
tempDoc = Http.url(url).get();
|
||||||
if (url.toExternalForm().substring(url.toExternalForm().length() - 1).equals("/")) {
|
// Get the thumbnail page so we can rip all images without loading every page in the comic
|
||||||
tempDoc = Http.url(url + "1").get();
|
String thumbnailLink = tempDoc.select("a[data-original-title=Thumbnails").attr("href");
|
||||||
} else {
|
return Http.url(thumbnailLink).get();
|
||||||
tempDoc = Http.url(url + "/1").get();
|
} catch (IOException e) {
|
||||||
}
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new IOException("Unable to get first page");
|
throw new IOException("Unable to get first page");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAlbumTitle(URL url) throws MalformedURLException {
|
public String getAlbumTitle(URL url) throws MalformedURLException {
|
||||||
|
Loading…
Reference in New Issue
Block a user