Fix for ehentai restricted galleries for #57
This commit is contained in:
parent
5d319355d3
commit
e88d00ddee
2
pom.xml
2
pom.xml
@ -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>
|
||||||
|
@ -43,17 +43,7 @@ public class EHentaiRipper extends AlbumRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
public URL sanitizeURL(URL url) throws MalformedURLException {
|
||||||
String u = url.toExternalForm();
|
return url;
|
||||||
if (u.contains("nw=session")) {
|
|
||||||
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 {
|
||||||
@ -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();
|
||||||
|
@ -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";
|
||||||
|
Loading…
Reference in New Issue
Block a user