From 6b0ecbf6bc40d0159405580e3ffb2653304b74ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 21 Feb 2021 19:06:12 +0100 Subject: [PATCH] [hentainexus] add 'orignal' option (#1322) --- docs/configuration.rst | 10 ++++++++++ gallery_dl/extractor/hentainexus.py | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 6aa9ff88..50e40f70 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1045,6 +1045,16 @@ Description You can use ``"all"`` instead of listing all values separately. +extractor.hentainexus.original +------------------------------ +Type + ``bool`` +Default + ``true`` +Description + Download original files instead of WebP versions. + + extractor.hitomi.metadata ------------------------- Type diff --git a/gallery_dl/extractor/hentainexus.py b/gallery_dl/extractor/hentainexus.py index 6d3ed74d..dbe576db 100644 --- a/gallery_dl/extractor/hentainexus.py +++ b/gallery_dl/extractor/hentainexus.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2019-2020 Mike Fährmann +# Copyright 2019-2021 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -63,6 +63,9 @@ class HentainexusGalleryExtractor(GalleryExtractor): data = json.loads(self._decode(text.extract( page, 'initReader("', '"')[0])) + if not self.config("original", True): + self.session.headers["Accept"] = "image/webp,*/*" + pages = data.get("pages") if pages: return [(page, None) for page in pages]