From 3939954cbd928664ea8e93bb6a1bc8fabc98e738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 22 Aug 2025 20:48:00 +0200 Subject: [PATCH] [shimmie2] support 'noz.rip/booru' (#8101) --- docs/supportedsites.md | 6 ++++ gallery_dl/extractor/shimmie2.py | 8 +++++- scripts/supportedsites.py | 1 + test/results/nozrip.py | 47 ++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 test/results/nozrip.py diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 36762e68..2867c25c 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -1573,6 +1573,12 @@ Consider all listed sites to potentially be NSFW. Posts, Tag Searches + + GaryC Booru + https://noz.rip/booru/ + Posts, Tag Searches + + szurubooru Instances diff --git a/gallery_dl/extractor/shimmie2.py b/gallery_dl/extractor/shimmie2.py index 9afa7060..82493421 100644 --- a/gallery_dl/extractor/shimmie2.py +++ b/gallery_dl/extractor/shimmie2.py @@ -85,6 +85,11 @@ BASE_PATTERN = Shimmie2Extractor.update({ "root": "https://vidya.pics", "pattern": r"vidya\.pics", }, + "nozrip": { + "root": "https://noz.rip/booru", + "base": "https://noz.rip", + "pattern": r"noz\.rip/booru", + }, }) + r"/(?:index\.php\?q=/?)?" @@ -196,13 +201,14 @@ class Shimmie2PostExtractor(Shimmie2Extractor): url = f"{self.root}/post/view/{post_id}" page = self.request(url).text extr = text.extract_from(page) + base = self.config_instance("base", self.root) qt = self._quote_type(page) post = { "id" : post_id, "tags" : extr(": ", "<").partition(" - ")[0].rstrip(")"), "md5" : extr("/_thumbs/", "/"), - "file_url": self.root + ( + "file_url": base + ( extr(f"id={qt}main_image{qt} src={qt}", qt) or extr("