[shimmie2] support 'noz.rip/booru' (#8101)

This commit is contained in:
Mike Fährmann
2025-08-22 20:48:00 +02:00
parent 9bfde2f535
commit 3939954cbd
4 changed files with 61 additions and 1 deletions

View File

@@ -1573,6 +1573,12 @@ Consider all listed sites to potentially be NSFW.
<td>Posts, Tag Searches</td>
<td></td>
</tr>
<tr id="nozrip" title="nozrip">
<td>GaryC Booru</td>
<td>https://noz.rip/booru/</td>
<td>Posts, Tag Searches</td>
<td></td>
</tr>
<tr id="szurubooru" title="szurubooru">
<td colspan="4"><strong>szurubooru Instances</strong></td>

View File

@@ -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("<source src="+qt, qt)).lstrip("."),
"width" : extr("data-width=", " ").strip("\"'"),

View File

@@ -126,6 +126,7 @@ CATEGORY_MAP = {
"nhentai" : "nhentai",
"nijie" : "nijie",
"nozomi" : "Nozomi.la",
"nozrip" : "GaryC Booru",
"nsfwalbum" : "NSFWalbum.com",
"nudostar" : "NudoStar.TV",
"paheal" : "Rule 34",

47
test/results/nozrip.py Normal file
View File

@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
# 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
# published by the Free Software Foundation.
from gallery_dl.extractor import shimmie2
__tests__ = (
{
"#url" : "https://noz.rip/booru/post/view/29",
"#category": ("shimmie2", "nozrip", "post"),
"#class" : shimmie2.Shimmie2PostExtractor,
"#results" : "https://noz.rip/booru/_images/f33d9e0da3ba476f67ef18911e05876b/29%20-%20inkling%20series%3Asplatoon%20unknown_artist%20wat.png",
"id" : 29,
"filename" : "29 - inkling series:splatoon unknown_artist wat",
"extension": "png",
"file_url" : "https://noz.rip/booru/_images/f33d9e0da3ba476f67ef18911e05876b/29%20-%20inkling%20series%3Asplatoon%20unknown_artist%20wat.png",
"width" : 798,
"height" : 598,
"md5" : "f33d9e0da3ba476f67ef18911e05876b",
"size" : 0,
"tags" : "inkling series:splatoon unknown_artist wat",
},
{
"#url" : "https://noz.rip/booru/post/list/inkling/1",
"#category": ("shimmie2", "nozrip", "tag"),
"#class" : shimmie2.Shimmie2TagExtractor,
"#pattern" : r"https://noz\.rip/booru/_images/[0-9a-f]{32}/\d+.+\.\w+",
"#count" : range(130, 150),
"id" : int,
"filename" : str,
"extension" : {"jpeg", "jpg", "png"},
"file_url" : str,
"width" : int,
"height" : int,
"size" : int,
"md5" : "len:str:32",
"search_tags": "inkling",
"tags" : str,
},
)