1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-01-17 04:38:18 +01: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,8 +144,17 @@ public class ImagefapRipper extends AbstractHTMLRipper {
}
String image = getFullSizedImage("https://www.imagefap.com" + thumb.parent().attr("href"));
if(image == null)
throw new RuntimeException("Unable to extract image URL from single image page! Unable to continue");
if (image == null) {
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 + "'");