ModelmayhemRipper can now donwload nsfw images again
This commit is contained in:
parent
a855957ab1
commit
5dabdd16ed
@ -4,7 +4,9 @@ import java.io.IOException;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@ -16,6 +18,8 @@ import com.rarchives.ripme.utils.Http;
|
|||||||
|
|
||||||
public class ModelmayhemRipper extends AbstractHTMLRipper {
|
public class ModelmayhemRipper extends AbstractHTMLRipper {
|
||||||
|
|
||||||
|
private Map<String,String> cookies = new HashMap<>();
|
||||||
|
|
||||||
public ModelmayhemRipper(URL url) throws IOException {
|
public ModelmayhemRipper(URL url) throws IOException {
|
||||||
super(url);
|
super(url);
|
||||||
}
|
}
|
||||||
@ -43,8 +47,10 @@ public class ModelmayhemRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getFirstPage() throws IOException {
|
public Document getFirstPage() throws IOException {
|
||||||
|
// Bypass NSFW filter
|
||||||
|
cookies.put("worksafe", "0");
|
||||||
// "url" is an instance field of the superclass
|
// "url" is an instance field of the superclass
|
||||||
return Http.url(url).get();
|
return Http.url(url).cookies(cookies).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user