mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-27 07:44:20 +02:00
Merge pull request #1259 from cyian-1756/8muses-fixes
8muses ripper no longer makes unneeded requests
This commit is contained in:
@@ -115,27 +115,23 @@ public class EightmusesRipper extends AbstractHTMLRipper {
|
|||||||
String image = null;
|
String image = null;
|
||||||
if (thumb.hasAttr("data-cfsrc")) {
|
if (thumb.hasAttr("data-cfsrc")) {
|
||||||
image = thumb.attr("data-cfsrc");
|
image = thumb.attr("data-cfsrc");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Deobfustace the json data
|
// Deobfustace the json data
|
||||||
String rawJson = deobfuscateJSON(page.select("script#ractive-public").html()
|
String rawJson = deobfuscateJSON(page.select("script#ractive-public").html()
|
||||||
.replaceAll(">", ">").replaceAll("<", "<").replace("&", "&"));
|
.replaceAll(">", ">").replaceAll("<", "<").replace("&", "&"));
|
||||||
|
LOGGER.info(rawJson);
|
||||||
JSONObject json = new JSONObject(rawJson);
|
JSONObject json = new JSONObject(rawJson);
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i != json.getJSONArray("pictures").length(); i++) {
|
for (int i = 0; i != json.getJSONArray("pictures").length(); i++) {
|
||||||
image = "https://www.8muses.com/image/fl/" + json.getJSONArray("pictures").getJSONObject(i).getString("publicUri");
|
image = "https://www.8muses.com/image/fl/" + json.getJSONArray("pictures").getJSONObject(i).getString("publicUri");
|
||||||
URL imageUrl = new URL(image);
|
URL imageUrl = new URL(image);
|
||||||
if (Utils.getConfigBoolean("8muses.use_short_names", false)) {
|
addURLToDownload(imageUrl, getPrefixShort(x), getSubdir(page.select("title").text()), this.url.toExternalForm(), cookies, "", null, true);
|
||||||
addURLToDownload(imageUrl, getPrefixShort(x), getSubdir(page.select("title").text()), this.url.toExternalForm(), cookies, "", null, true);
|
|
||||||
} else {
|
|
||||||
addURLToDownload(imageUrl, getPrefixLong(x), getSubdir(page.select("title").text()), this.url.toExternalForm(), cookies, "", null, true);
|
|
||||||
}
|
|
||||||
// X is our page index
|
// X is our page index
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
|
return imageURLs;
|
||||||
} catch (IOException e) {
|
} catch (MalformedURLException e) {
|
||||||
continue;
|
LOGGER.error("\"" + image + "\" is malformed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!image.contains("8muses.com")) {
|
if (!image.contains("8muses.com")) {
|
||||||
|
Reference in New Issue
Block a user