[schalenetwork][hdoujin] re-implement 'cbz' option (#8431)

This commit is contained in:
Mike Fährmann
2025-10-18 20:57:58 +02:00
parent 9ad937a982
commit 11ccadfd8c
3 changed files with 50 additions and 2 deletions

View File

@@ -169,6 +169,20 @@ class SchalenetworkGalleryExtractor(SchalenetworkExtractor, GalleryExtractor):
url = (f"{self.root_api}/books/data/{gid}/{gkey}"
f"/{fmt['id']}/{fmt['key']}/{fmt['w']}?crt={self._crt()}")
headers = self.headers
if self.config("cbz", False):
headers["Authorization"] = self._token()
dl = self.request_json(
f"{url}&action=dl", method="POST", headers=headers)
# 'crt' parameter here is necessary for 'hdoujin' downloads
url = f"{dl['base']}?crt={self._crt()}"
info = text.nameext_from_url(url)
if "fallback" in dl:
info["_fallback"] = (dl["fallback"],)
if not info["extension"]:
info["extension"] = "cbz"
return ((url, info),)
data = self.request_json(url, headers=headers)
base = data["base"]