use of org.jsoup.Connection.Response in project ripme by RipMeApp.
the class HentaifoundryRipper method getFirstPage.
@Override
public Document getFirstPage() throws IOException {
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();
// 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).referrer("http://www.hentai-foundry.com/").cookies(cookies).response();
cookies.putAll(resp.cookies());
return resp.parse();
}
use of org.jsoup.Connection.Response in project ripme by RipMeApp.
the class HentaifoundryRipper method getURLsFromPage.
@Override
public List<String> getURLsFromPage(Document doc) {
List<String> imageURLs = new ArrayList<>();
Pattern imgRegex = Pattern.compile(".*/user/([a-zA-Z0-9\\-_]+)/(\\d+)/.*");
for (Element thumb : doc.select("div.thumb_square > a.thumbLink")) {
if (isStopped()) {
break;
}
Matcher imgMatcher = imgRegex.matcher(thumb.attr("href"));
if (!imgMatcher.matches()) {
logger.info("Couldn't find user & image ID in " + thumb.attr("href"));
continue;
}
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.")) {
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;
}
use of org.jsoup.Connection.Response in project ripme by RipMeApp.
the class EightmusesRipper method getFirstPage.
@Override
public Document getFirstPage() throws IOException {
if (albumDoc == null) {
Response resp = Http.url(url).response();
cookies.putAll(resp.cookies());
albumDoc = resp.parse();
}
return albumDoc;
}
use of org.jsoup.Connection.Response in project ripme by RipMeApp.
the class EroShareRipper method getFirstPage.
@Override
public Document getFirstPage() throws IOException {
String urlToDownload = this.url.toExternalForm();
Response resp = Http.url(urlToDownload.replace("eroshare.com", "eroshae.com")).ignoreContentType().response();
return resp.parse();
}
use of org.jsoup.Connection.Response in project ripme by RipMeApp.
the class EromeRipper method getURLs.
public static List<URL> getURLs(URL url) throws IOException {
Response resp = Http.url(url).ignoreContentType().response();
Document doc = resp.parse();
List<URL> URLs = new ArrayList<>();
// Pictures
Elements imgs = doc.getElementsByTag("img");
for (Element img : imgs) {
if (img.hasClass("album-image")) {
String imageURL = img.attr("src");
imageURL = "https:" + imageURL;
URLs.add(new URL(imageURL));
}
}
// Videos
Elements vids = doc.getElementsByTag("video");
for (Element vid : vids) {
if (vid.hasClass("album-video")) {
Elements source = vid.getElementsByTag("source");
String videoURL = source.first().attr("src");
URLs.add(new URL(videoURL));
}
}
return URLs;
}
Aggregations