1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-30 17:20:20 +02:00

Fix FitnakedgirlsRipper and add FitnakedgirlsRipperTest (Fixes #2097)

This commit is contained in:
MetaPrime
2025-02-02 02:46:27 -08:00
parent f2c9974265
commit 7cd39c8621
2 changed files with 31 additions and 5 deletions

View File

@@ -35,10 +35,10 @@ public class FitnakedgirlsRipper extends AbstractHTMLRipper {
Pattern p;
Matcher m;
p = Pattern.compile("^.*fitnakedgirls\\.com/gallery/(.+)$");
p = Pattern.compile("^https?://(\\w+\\.)?fitnakedgirls\\.com/photos/gallery/(.+)$");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
return m.group(1);
return m.group(2);
}
throw new MalformedURLException(
@@ -49,9 +49,15 @@ public class FitnakedgirlsRipper extends AbstractHTMLRipper {
public List<String> getURLsFromPage(Document doc) {
List<String> imageURLs = new ArrayList<>();
Elements imgs = doc.select("div[class*=wp-tiles-tile-bg] > img");
Elements imgs = doc.select(".entry-inner img");
for (Element img : imgs) {
String imgSrc = img.attr("src");
String imgSrc = img.attr("data-src");
if (imgSrc.strip().isEmpty()) {
imgSrc = img.attr("src");
if (imgSrc.strip().isEmpty()) {
continue;
}
}
imageURLs.add(imgSrc);
}
@@ -60,7 +66,10 @@ public class FitnakedgirlsRipper extends AbstractHTMLRipper {
@Override
public void downloadURL(URL url, int index) {
// site is slow and goes down easily so don't overwhelm it
sleep(1000);
// Send referrer when downloading images
addURLToDownload(url, getPrefix(index), "", this.url.toExternalForm(), null);
}
}
}

View File

@@ -0,0 +1,17 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.junit.jupiter.api.Test;
import com.rarchives.ripme.ripper.rippers.FitnakedgirlsRipper;
public class FitnakedgirlsRipperTest extends RippersTest {
@Test
public void testRip() throws IOException, URISyntaxException {
FitnakedgirlsRipper ripper = new FitnakedgirlsRipper(new URI("https://fitnakedgirls.com/photos/gallery/erin-ashford-nude/").toURL());
testRipper(ripper);
}
}