[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

@@ -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]