mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-28 08:10:11 +02:00
Merge pull request #1103 from cyian-1756/HentaiFoundryStories
Added support for 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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,7 +7,12 @@ import com.rarchives.ripme.ripper.rippers.HentaifoundryRipper;
|
|||||||
|
|
||||||
public class HentaifoundryRipperTest extends RippersTest {
|
public class HentaifoundryRipperTest extends RippersTest {
|
||||||
public void testHentaifoundryRip() throws IOException {
|
public void testHentaifoundryRip() throws IOException {
|
||||||
HentaifoundryRipper ripper = new HentaifoundryRipper(new URL("http://www.hentai-foundry.com/pictures/user/personalami"));
|
HentaifoundryRipper ripper = new HentaifoundryRipper(new URL("https://www.hentai-foundry.com/pictures/user/personalami"));
|
||||||
|
testRipper(ripper);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testHentaifoundryPdfRip() throws IOException {
|
||||||
|
HentaifoundryRipper ripper = new HentaifoundryRipper(new URL("https://www.hentai-foundry.com/stories/user/Rakked"));
|
||||||
testRipper(ripper);
|
testRipper(ripper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user