From f8690854768b3e91a7f080a51d097819cd183dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 23 Jan 2026 09:22:41 +0100 Subject: [PATCH] [weebdex] add 'data-saver' option (#8914) --- docs/configuration.rst | 10 ++++++++++ docs/gallery-dl.conf | 4 ++++ gallery_dl/extractor/weebdex.py | 12 ++++++++++-- test/results/weebdex.py | 21 +++++++++++++++++---- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 452c5152..90d8d80f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index f49d3e8e..18b98167 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -963,6 +963,10 @@ { "sleep-request": "0.5-1.5" }, + "weebdex": + { + "data-saver": false + }, "weibo": { "sleep-request": "1.0-2.0", diff --git a/gallery_dl/extractor/weebdex.py b/gallery_dl/extractor/weebdex.py index 78fbda1b..69207d5f 100644 --- a/gallery_dl/extractor/weebdex.py +++ b/gallery_dl/extractor/weebdex.py @@ -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 ] diff --git a/test/results/weebdex.py b/test/results/weebdex.py index aedbbf25..5d72c8b0 100644 --- a/test/results/weebdex.py +++ b/test/results/weebdex.py @@ -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——……