1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-01 19:40:18 +02:00

Imagefap: add retry logic for getFullSizedImage() (#181)

This commit is contained in:
joroto
2024-03-11 08:27:58 +02:00
committed by GitHub
parent eb351d4b05
commit ab2b27c6a6

View File

@@ -144,8 +144,17 @@ public class ImagefapRipper extends AbstractHTMLRipper {
} }
String image = getFullSizedImage("https://www.imagefap.com" + thumb.parent().attr("href")); String image = getFullSizedImage("https://www.imagefap.com" + thumb.parent().attr("href"));
if(image == null) if (image == null) {
throw new RuntimeException("Unable to extract image URL from single image page! Unable to continue"); for (int i = 0; i < HTTP_RETRY_LIMIT; i++) {
image = getFullSizedImage("https://www.imagefap.com" + thumb.parent().attr("href"));
if (image != null) {
break;
}
sleep(PAGE_SLEEP_TIME);
}
if (image == null)
throw new RuntimeException("Unable to extract image URL from single image page! Unable to continue");
}
LOGGER.debug("Adding imageURL: '" + image + "'"); LOGGER.debug("Adding imageURL: '" + image + "'");