mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-25 23:06:22 +02:00
Got sub album suppport working
This commit is contained in:
@@ -75,7 +75,7 @@ public class ErofusRipper extends AbstractHTMLRipper {
|
|||||||
int x = 1;
|
int x = 1;
|
||||||
if (pageContainsImages(page)) {
|
if (pageContainsImages(page)) {
|
||||||
LOGGER.info("Page contains images");
|
LOGGER.info("Page contains images");
|
||||||
imageURLs.addAll(ripAlbum(page));
|
ripAlbum(page);
|
||||||
} else {
|
} else {
|
||||||
// This contains the thumbnails of all images on the page
|
// This contains the thumbnails of all images on the page
|
||||||
Elements pageImages = page.select("a.a-click");
|
Elements pageImages = page.select("a.a-click");
|
||||||
@@ -100,21 +100,21 @@ public class ErofusRipper extends AbstractHTMLRipper {
|
|||||||
return imageURLs;
|
return imageURLs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> ripAlbum(Document page) {
|
public void ripAlbum(Document page) {
|
||||||
int x = 1;
|
int x = 1;
|
||||||
List<String> imageURLs = new ArrayList<>();
|
|
||||||
Elements thumbs = page.select("a.a-click > div.thumbnail > img");
|
Elements thumbs = page.select("a.a-click > div.thumbnail > img");
|
||||||
for (Element thumb : thumbs) {
|
for (Element thumb : thumbs) {
|
||||||
String image = "https://www.erofus.com" + thumb.attr("src").replaceAll("thumb", "medium");
|
String image = "https://www.erofus.com" + thumb.attr("src").replaceAll("thumb", "medium");
|
||||||
imageURLs.add(image);
|
|
||||||
try {
|
try {
|
||||||
addURLToDownload(new URL(image), getPrefix(x));
|
Map<String,String> opts = new HashMap<String, String>();
|
||||||
|
opts.put("subdirectory", page.title().replaceAll(" \\| Erofus - Sex and Porn Comics", "").replaceAll(" ", "_"));
|
||||||
|
opts.put("prefix", getPrefix(x));
|
||||||
|
addURLToDownload(new URL(image), opts);
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
LOGGER.info(e.getMessage());
|
LOGGER.info(e.getMessage());
|
||||||
}
|
}
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
return imageURLs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean pageContainsImages(Document page) {
|
private boolean pageContainsImages(Document page) {
|
||||||
|
Reference in New Issue
Block a user