1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-26 23:34:53 +02:00

Added the abilty to rip hentai foundry stories

This commit is contained in:
cyian-1756
2018-12-13 06:01:30 -05:00
parent 6f896019a5
commit 3b2b1d356d

View File

@@ -37,7 +37,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
@Override
public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^.*hentai-foundry\\.com/pictures/user/([a-zA-Z0-9\\-_]+).*$");
Pattern p = Pattern.compile("^.*hentai-foundry\\.com/(pictures|stories)/user/([a-zA-Z0-9\\-_]+).*$");
Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) {
return m.group(1);
@@ -132,6 +132,13 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
@Override
public List<String> getURLsFromPage(Document doc) {
List<String> imageURLs = new ArrayList<>();
// this if is for ripping pdf stories
if (url.toExternalForm().contains("/stories/")) {
for (Element pdflink : doc.select("a.pdfLink")) {
imageURLs.add("http://www.hentai-foundry.com" + pdflink.attr("href"));
}
return imageURLs;
}
Pattern imgRegex = Pattern.compile(".*/user/([a-zA-Z0-9\\-_]+)/(\\d+)/.*");
for (Element thumb : doc.select("div.thumb_square > a.thumbLink")) {
if (isStopped()) {
@@ -167,6 +174,10 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
@Override
public void downloadURL(URL url, int index) {
// When downloading pdfs you *NEED* to end the cookies with the request or you just get the consent page
if (url.toExternalForm().endsWith(".pdf")) {
addURLToDownload(url, getPrefix(index), "", this.url.toExternalForm(), cookies);
}
addURLToDownload(url, getPrefix(index));
}