mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 15:24:51 +02:00
Added the abilty to rip hentai foundry stories
This commit is contained in:
@@ -37,7 +37,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
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());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(1);
|
return m.group(1);
|
||||||
@@ -132,6 +132,13 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getURLsFromPage(Document doc) {
|
public List<String> getURLsFromPage(Document doc) {
|
||||||
List<String> imageURLs = new ArrayList<>();
|
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+)/.*");
|
Pattern imgRegex = Pattern.compile(".*/user/([a-zA-Z0-9\\-_]+)/(\\d+)/.*");
|
||||||
for (Element thumb : doc.select("div.thumb_square > a.thumbLink")) {
|
for (Element thumb : doc.select("div.thumb_square > a.thumbLink")) {
|
||||||
if (isStopped()) {
|
if (isStopped()) {
|
||||||
@@ -167,6 +174,10 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void downloadURL(URL url, int index) {
|
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));
|
addURLToDownload(url, getPrefix(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user