[hentainexus] add 'orignal' option (#1322)

This commit is contained in:
Mike Fährmann
2021-02-21 19:06:12 +01:00
parent 03b219db9d
commit 6b0ecbf6bc
2 changed files with 14 additions and 1 deletions

View File

@@ -1045,6 +1045,16 @@ Description
You can use ``"all"`` instead of listing all values separately. 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 extractor.hitomi.metadata
------------------------- -------------------------
Type Type

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- 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 # 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 # 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( data = json.loads(self._decode(text.extract(
page, 'initReader("', '"')[0])) page, 'initReader("', '"')[0]))
if not self.config("original", True):
self.session.headers["Accept"] = "image/webp,*/*"
pages = data.get("pages") pages = data.get("pages")
if pages: if pages:
return [(page, None) for page in pages] return [(page, None) for page in pages]