1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-22 21:43:06 +02:00

Added check if login URL results in 404 for development purpose

This commit is contained in:
MrPlaygon
2019-04-04 20:12:41 +02:00
parent 3781737786
commit ed2082dfe8

View File

@@ -394,6 +394,7 @@ public class DeviantartRipper extends AbstractHTMLRipper {
/** /**
* Updates cookies * Updates cookies
*
* @param m new Cookies * @param m new Cookies
*/ */
private void updateCookie(Map<String, String> m) { private void updateCookie(Map<String, String> m) {
@@ -421,7 +422,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
e.printStackTrace(); e.printStackTrace();
} }
} }
/** /**
@@ -564,13 +564,14 @@ public class DeviantartRipper extends AbstractHTMLRipper {
.followRedirects(true).execute(); .followRedirects(true).execute();
URL location = download.url(); URL location = download.url();
System.out.println("----------------> " + url);
String[] filetypePart = download.header("Content-Disposition").split("\\."); String[] filetypePart = download.header("Content-Disposition").split("\\.");
LOGGER.info("Found Image URL"); LOGGER.info("Found Image URL");
LOGGER.info(url); LOGGER.info(url);
LOGGER.info(location); LOGGER.info(location);
addURLToDownload(location, "", "", "", new HashMap<String, String>(), addURLToDownload(location, "", "", "", getDACookie(),
title + "." + filetypePart[filetypePart.length - 1]); title + "." + filetypePart[filetypePart.length - 1]);
return; return;
} }
@@ -614,7 +615,14 @@ public class DeviantartRipper extends AbstractHTMLRipper {
LOGGER.info("Found Image URL"); LOGGER.info("Found Image URL");
LOGGER.info(url); LOGGER.info(url);
LOGGER.info(parts[0]); LOGGER.info(parts[0]);
while (Http.url(parts[0]).connection().execute().statusCode() == 404) {
try {
LOGGER.error("404 on " + url);
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
addURLToDownload(new URL(parts[0]), "", "", "", new HashMap<String, String>(), addURLToDownload(new URL(parts[0]), "", "", "", new HashMap<String, String>(),
title + "." + tmpParts[tmpParts.length - 1]); title + "." + tmpParts[tmpParts.length - 1]);
return; return;