Fix for ehentai restricted galleries for #57

This commit is contained in:
4pr0n 2014-06-07 17:35:58 -07:00
parent 5d319355d3
commit e88d00ddee
3 changed files with 7 additions and 13 deletions

View File

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

View File

@ -43,18 +43,8 @@ public class EHentaiRipper extends AlbumRipper {
} }
public URL sanitizeURL(URL url) throws MalformedURLException { public URL sanitizeURL(URL url) throws MalformedURLException {
String u = url.toExternalForm();
if (u.contains("nw=session")) {
return url; return url;
} }
else if (u.contains("?")) {
u += "&nw=session";
}
else {
u += "?nw=session";
}
return new URL(u);
}
public String getAlbumTitle(URL url) throws MalformedURLException { public String getAlbumTitle(URL url) throws MalformedURLException {
try { try {
@ -64,6 +54,8 @@ public class EHentaiRipper extends AlbumRipper {
sendUpdate(STATUS.LOADING_RESOURCE, url.toString()); sendUpdate(STATUS.LOADING_RESOURCE, url.toString());
albumDoc = Jsoup.connect(url.toExternalForm()) albumDoc = Jsoup.connect(url.toExternalForm())
.userAgent(USER_AGENT) .userAgent(USER_AGENT)
.cookie("nw", "1")
.cookie("tip", "1")
.timeout(5000) .timeout(5000)
.get(); .get();
} }
@ -106,6 +98,7 @@ public class EHentaiRipper extends AlbumRipper {
sendUpdate(STATUS.LOADING_RESOURCE, nextUrl); sendUpdate(STATUS.LOADING_RESOURCE, nextUrl);
albumDoc = Jsoup.connect(nextUrl) albumDoc = Jsoup.connect(nextUrl)
.userAgent(USER_AGENT) .userAgent(USER_AGENT)
.cookie("nw", "1")
.timeout(5000) .timeout(5000)
.referrer(this.url.toExternalForm()) .referrer(this.url.toExternalForm())
.get(); .get();
@ -211,6 +204,7 @@ public class EHentaiRipper extends AlbumRipper {
try { try {
Document doc = Jsoup.connect(this.url.toExternalForm()) Document doc = Jsoup.connect(this.url.toExternalForm())
.userAgent(USER_AGENT) .userAgent(USER_AGENT)
.cookie("nw", "1")
.timeout(5000) .timeout(5000)
.referrer(this.url.toExternalForm()) .referrer(this.url.toExternalForm())
.get(); .get();

View File

@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils;
public class UpdateUtils { public class UpdateUtils {
private static final Logger logger = Logger.getLogger(UpdateUtils.class); private static final Logger logger = Logger.getLogger(UpdateUtils.class);
private static final String DEFAULT_VERSION = "1.0.57"; private static final String DEFAULT_VERSION = "1.0.58";
private static final String updateJsonURL = "http://rarchives.com/ripme.json"; private static final String updateJsonURL = "http://rarchives.com/ripme.json";
private static final String updateJarURL = "http://rarchives.com/ripme.jar"; private static final String updateJarURL = "http://rarchives.com/ripme.jar";
private static final String mainFileName = "ripme.jar"; private static final String mainFileName = "ripme.jar";