[weebdex] add 'data-saver' option (#8914)

This commit is contained in:
Mike Fährmann
2026-01-23 09:22:41 +01:00
parent 72322deaee
commit f869085476
4 changed files with 41 additions and 6 deletions

View File

@@ -6936,6 +6936,16 @@ Description
Useful for creating CBZ archives with actual source thumbnails.
extractor.weebdex.data-saver
----------------------------
Type
``bool``
Default
``false``
Description
Enable `Data Saver` mode and download lower quality versions of chapters.
extractor.weibo.gifs
--------------------
Type

View File

@@ -963,6 +963,10 @@
{
"sleep-request": "0.5-1.5"
},
"weebdex":
{
"data-saver": false
},
"weibo":
{
"sleep-request": "1.0-2.0",

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Mike Fährmann
# Copyright 2025-2026 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
@@ -65,12 +65,20 @@ class WeebdexChapterExtractor(WeebdexBase, ChapterExtractor):
data = self.data
base = f"{data['node']}/data/{data['id']}/"
if self.config("data-saver", False):
pages = data["data_optimized"]
original = False
else:
pages = data["data"]
original = True
return [
(base + page["name"], {
"width" : page["dimensions"][0],
"height": page["dimensions"][1],
"original": original,
})
for page in data["data"]
for page in pages
]

View File

@@ -11,7 +11,7 @@ __tests__ = (
{
"#url" : "https://weebdex.org/chapter/f6c0awnrba",
"#class" : weebdex.WeebdexChapterExtractor,
"#pattern" : r"https://s\d+\.notdelta\.xyz/data/f6c0awnrba/\d+-\w{64}\.png",
"#pattern" : r"https://s\d+\.weebdex\.net/data/f6c0awnrba/\d+-\w{64}\.png",
"#count" : 14,
"artist" : ["Nokomi (のこみ)"],
@@ -66,7 +66,7 @@ ___
{
"#url" : "https://weebdex.org/chapter/itizot1rxc",
"#class" : weebdex.WeebdexChapterExtractor,
"#pattern" : r"https://s\d+\.notdelta\.xyz/data/itizot1rxc/\d+\-\w+\.jpg",
"#pattern" : r"https://s\d+\.weebdex\.net/data/itizot1rxc/\d+\-\w+\.jpg",
"#count" : 17,
"artist" : ["Matsuda Minoru"],
@@ -83,12 +83,25 @@ ___
"manga_id" : "3o0icxno26",
"origin" : "ja",
"title" : "Cuộc hẹn tại phía Đông vườn địa đàng",
"uploader" : "sMrBjZf",
"uploader" : "wSwPTgL",
"version" : 1,
"volume" : 2,
"year" : 2021,
},
{
"#url" : "https://weebdex.org/chapter/itizot1rxc",
"#comment" : "'data-saver' option (#8914)",
"#class" : weebdex.WeebdexChapterExtractor,
"#options" : {"data-saver": True},
"#range" : "1-3",
"#results" : (
"https://s11.weebdex.net/data/itizot1rxc/1-fa838df3d9b2d16ab3f900a5d74d8e1fe2b15446825978209053297b8e3f7d0d.webp",
"https://s11.weebdex.net/data/itizot1rxc/2-b4914436ab21e7915440024a5b5bd705c3a844df314c3c7d722388b3ce81626a.webp",
"https://s11.weebdex.net/data/itizot1rxc/3-6b0e1901cfae7d6d5c21769d714c992fb1fa1af6e9e8e10083ea5a6bf5d53cef.webp",
),
},
{
"#url" : "https://weebdex.org/title/3o0icxno26/ani-datta-mono",
"#class" : weebdex.WeebdexMangaExtractor,
@@ -111,7 +124,7 @@ ___
"manga_id" : "3o0icxno26",
"origin" : "ja",
"status" : "ongoing",
"version" : {1, 2},
"version" : {1, 2, 3, 4},
"year" : 2021,
"description" : """\
My brother died. When I went to visit my brother's grave with my brother's lover——……