Merge pull request #560 from cyian-1756/nude-gals.com

Fixed NudeGalsRipper
This commit is contained in:
cyian-1756 2018-05-08 08:04:30 -04:00 committed by GitHub
commit f64f1bc653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 19 deletions

View File

@ -33,23 +33,6 @@ public class NudeGalsRipper extends AbstractHTMLRipper {
return "nude-gals.com"; 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 @Override
public String getGID(URL url) throws MalformedURLException { public String getGID(URL url) throws MalformedURLException {
Pattern p; Pattern p;
@ -79,9 +62,9 @@ public class NudeGalsRipper extends AbstractHTMLRipper {
public List<String> getURLsFromPage(Document doc) { public List<String> getURLsFromPage(Document doc) {
List<String> imageURLs = new ArrayList<>(); List<String> imageURLs = new ArrayList<>();
Elements thumbs = doc.select("#grid_container .grid > .grid_box"); Elements thumbs = doc.select("img.thumbnail");
for (Element thumb : thumbs) { 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; String imgSrc = "http://nude-gals.com/" + link;
imageURLs.add(imgSrc); imageURLs.add(imgSrc);
} }

View File

@ -0,0 +1,18 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import com.rarchives.ripme.ripper.rippers.NudeGalsRipper;
public class NudeGalsRipperTest extends RippersTest {
public void testRip() throws IOException {
NudeGalsRipper ripper = new NudeGalsRipper(new URL("https://nude-gals.com/photoshoot.php?photoshoot_id=5541"));
testRipper(ripper);
}
public void testGetGID() throws IOException {
NudeGalsRipper ripper = new NudeGalsRipper(new URL("https://nude-gals.com/photoshoot.php?photoshoot_id=5541"));
assertEquals("5541", ripper.getGID( new URL("https://nude-gals.com/photoshoot.php?photoshoot_id=5541")));
}
}