Merge remote-tracking branch 'refs/remotes/4pr0n/master'

This commit is contained in:
Wiiplay123 2017-04-29 14:14:06 -05:00
commit d55cf06c90
5 changed files with 43 additions and 13 deletions

8
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"files.exclude": {
"target/**": true,
"**/.git": true,
"**/.DS_Store": true
},
"java.configuration.updateBuildConfiguration": "automatic"
}

View File

@ -4,7 +4,7 @@
<groupId>com.rarchives.ripme</groupId>
<artifactId>ripme</artifactId>
<packaging>jar</packaging>
<version>1.4.8</version>
<version>1.4.9</version>
<name>ripme</name>
<url>http://rip.rarchives.com</url>
<properties>

View File

@ -1,6 +1,7 @@
{
"latestVersion" : "1.4.8",
"latestVersion" : "1.4.9",
"changeList" : [
"1.4.9: Fixed HentaiFoundry ripper",
"1.4.8: Added Jagodibuja comics ripper",
"1.4.7: Fixed NewsFilter, XHamster; added TheChiveRipper",
"1.4.6: Eroshare: get album names; Imgur: improve grabbing album name.",

View File

@ -55,6 +55,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
.referrer("http://www.hentai-foundry.com/")
.cookies(cookies)
.response();
// The only cookie that seems to matter in getting around the age wall is the phpsession cookie
cookies.putAll(resp.cookies());
sleep(500);
resp = Http.url(url)
@ -64,10 +65,10 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
cookies.putAll(resp.cookies());
return resp.parse();
}
@Override
public Document getNextPage(Document doc) throws IOException {
if (doc.select("li.next.hidden").size() > 0) {
if (doc.select("li.next.hidden").size() != 0) {
// Last page
throw new IOException("No more pages");
}
@ -85,7 +86,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
public List<String> getURLsFromPage(Document doc) {
List<String> imageURLs = new ArrayList<String>();
Pattern imgRegex = Pattern.compile(".*/user/([a-zA-Z0-9\\-_]+)/(\\d+)/.*");
for (Element thumb : doc.select("td > a:first-child")) {
for (Element thumb : doc.select("div.thumb_square > a.thumbLink")) {
if (isStopped()) {
break;
}
@ -94,16 +95,36 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
logger.info("Couldn't find user & image ID in " + thumb.attr("href"));
continue;
}
String user = imgMatcher.group(1),
imageId = imgMatcher.group(2);
String image = "http://pictures.hentai-foundry.com//";
image += user.toLowerCase().charAt(0);
image += "/" + user + "/" + imageId + ".jpg";
imageURLs.add(image);
Document imagePage;
try {
Response resp = Http.url("http://www.hentai-foundry.com/").response();
cookies = resp.cookies();
resp = Http.url("http://www.hentai-foundry.com/?enterAgree=1&size=1500")
.referrer("http://www.hentai-foundry.com/")
.cookies(cookies)
.response();
cookies.putAll(resp.cookies());
logger.info("grabbing " + "http://www.hentai-foundry.com" + thumb.attr("href"));
imagePage = Http.url("http://www.hentai-foundry.com" + thumb.attr("href")).cookies(cookies).get();
}
catch (IOException e) {
logger.debug(e.getMessage());
logger.debug("Warning: imagePage is null!");
imagePage = null;
}
// This is here for when the image is resized to a thumbnail because ripme doesn't report a screensize
if (imagePage.select("div.boxbody > img.center").attr("src").contains("thumbs.") == true) {
imageURLs.add("http:" + imagePage.select("div.boxbody > img.center").attr("onclick").replace("this.src=", "").replace("'", "").replace("; $(#resize_message).hide();", ""));
}
else {
imageURLs.add("http:" + imagePage.select("div.boxbody > img.center").attr("src"));
}
}
return imageURLs;
}
@Override
public void downloadURL(URL url, int index) {
addURLToDownload(url, getPrefix(index));

View File

@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils;
public class UpdateUtils {
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
private static final String DEFAULT_VERSION = "1.4.8";
private static final String DEFAULT_VERSION = "1.4.9";
private static final String updateJsonURL = "https://raw.githubusercontent.com/4pr0n/ripme/master/ripme.json";
private static final String mainFileName = "ripme.jar";
private static final String updateFileName = "ripme.jar.update";