Skip to content

Commit

Permalink
Fix FitnakedgirlsRipper and add FitnakedgirlsRipperTest (Fixes #2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
metaprime committed Feb 2, 2025
1 parent f2c9974 commit 7cd39c8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public String getGID(URL url) throws MalformedURLException {
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(
Expand All @@ -49,9 +49,15 @@ public String getGID(URL url) throws MalformedURLException {
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);
}

Expand All @@ -60,7 +66,10 @@ public List<String> getURLsFromPage(Document doc) {

@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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 7cd39c8

Please sign in to comment.