From 8f3f061daf2df5084f025f55cefaba1d969283be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 5 Jul 2024 21:36:29 +0200 Subject: [PATCH] [hentainexus] fix error for spread pages (#5827) --- gallery_dl/extractor/hentainexus.py | 11 +++++++---- test/results/hentainexus.py | 9 +++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/hentainexus.py b/gallery_dl/extractor/hentainexus.py index 97b78445..286ee381 100644 --- a/gallery_dl/extractor/hentainexus.py +++ b/gallery_dl/extractor/hentainexus.py @@ -70,10 +70,13 @@ class HentainexusGalleryExtractor(GalleryExtractor): for img in imgs: img["_http_headers"] = headers - return [ - (img["image"], img) - for img in imgs - ] + results = [] + for img in imgs: + try: + results.append((img["image"], img)) + except KeyError: + pass + return results @staticmethod def _decode(data): diff --git a/test/results/hentainexus.py b/test/results/hentainexus.py index 8eae1bd1..01091350 100644 --- a/test/results/hentainexus.py +++ b/test/results/hentainexus.py @@ -40,6 +40,7 @@ __tests__ = ( "kimono", "pubic hair", "uncensored", + "unlimited", "vanilla", ], "title" : "Graduation!", @@ -54,6 +55,14 @@ __tests__ = ( "#class" : hentainexus.HentainexusGalleryExtractor, }, +{ + "#url" : "https://hentainexus.com/view/715", + "#comment" : "combined left-right pages (#5827)", + "#category": ("", "hentainexus", "gallery"), + "#class" : hentainexus.HentainexusGalleryExtractor, + "#count" : 2, +}, + { "#url" : "https://hentainexus.com/?q=tag:%22heart+pupils%22%20tag:group", "#category": ("", "hentainexus", "search"),