From 2001ada6f4291122a210e49db53f0b0d597ec308 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Sun, 6 May 2018 05:33:33 -0400 Subject: [PATCH] Fixed NudeGalsRipper --- .../ripme/ripper/rippers/NudeGalsRipper.java | 21 ++----------------- .../ripper/rippers/NudeGalsRipperTest.java | 4 ++++ 2 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 src/test/java/com/rarchives/ripme/tst/ripper/rippers/NudeGalsRipperTest.java diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/NudeGalsRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/NudeGalsRipper.java index d3cb0ab1..3300da50 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/NudeGalsRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/NudeGalsRipper.java @@ -33,23 +33,6 @@ public class NudeGalsRipper extends AbstractHTMLRipper { return "nude-gals.com"; } - public String getAlbumTitle(URL url) throws MalformedURLException { - try { - Document doc = getFirstPage(); - Elements elems = doc.select("#left_col > #grid_title > .right"); - - String girl = elems.get(3).text(); - String magazine = elems.get(2).text(); - String title = elems.get(0).text(); - - return getHost() + "_" + girl + "-" + magazine + "-" + title; - } catch (Exception e) { - // Fall back to default album naming convention - logger.warn("Failed to get album title from " + url, e); - } - return super.getAlbumTitle(url); - } - @Override public String getGID(URL url) throws MalformedURLException { Pattern p; @@ -79,9 +62,9 @@ public class NudeGalsRipper extends AbstractHTMLRipper { public List getURLsFromPage(Document doc) { List imageURLs = new ArrayList<>(); - Elements thumbs = doc.select("#grid_container .grid > .grid_box"); + Elements thumbs = doc.select("img.thumbnail"); for (Element thumb : thumbs) { - String link = thumb.select("a").get(1).attr("href"); + String link = thumb.attr("src").replaceAll("thumbs/th_", ""); String imgSrc = "http://nude-gals.com/" + link; imageURLs.add(imgSrc); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/NudeGalsRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/NudeGalsRipperTest.java new file mode 100644 index 00000000..e77fcea9 --- /dev/null +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/NudeGalsRipperTest.java @@ -0,0 +1,4 @@ +package com.rarchives.ripme.tst.ripper.rippers; + +public class NudeGalsRipperTest { +}