Merge pull request #791 from cyian-1756/deviantartGalleryFixes

Fixed minor bug with DeviantartRipper
This commit is contained in:
cyian-1756 2018-07-11 13:43:47 -04:00 committed by GitHub
commit 96738883b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,13 +260,13 @@ public class DeviantartRipper extends AbstractJSONRipper {
if (doc.html().contains("ismature")) { if (doc.html().contains("ismature")) {
LOGGER.info("Downloading nsfw image"); LOGGER.info("Downloading nsfw image");
String nsfwImage = getFullsizedNSFWImage(doc.select("span").attr("href")); String nsfwImage = getFullsizedNSFWImage(doc.select("span").attr("href"));
if (nsfwImage != null) { if (nsfwImage != null && nsfwImage.startsWith("http")) {
imageURLs.add(nsfwImage); imageURLs.add(nsfwImage);
} }
} }
try { try {
String imageURL = doc.select("span").first().attr("data-super-full-img"); String imageURL = doc.select("span").first().attr("data-super-full-img");
if (!imageURL.isEmpty()) { if (!imageURL.isEmpty() && imageURL.startsWith("http")) {
imageURLs.add(imageURL); imageURLs.add(imageURL);
} }
} catch (NullPointerException e) { } catch (NullPointerException e) {