From e61f016465c0edd71725c11dadfb66da57decce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 5 Jan 2024 17:56:39 +0100 Subject: [PATCH] [szurubooru] support 'snootbooru.com' (#5023) --- docs/supportedsites.md | 8 ++- gallery_dl/extractor/szurubooru.py | 4 ++ test/results/snootbooru.py | 79 ++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 test/results/snootbooru.py diff --git a/docs/supportedsites.md b/docs/supportedsites.md index dbdaac24..c0fee2a8 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -1037,7 +1037,7 @@ Consider all listed sites to potentially be NSFW. JPG Fish - https://jpg2.su/ + https://jpg4.su/ Albums, individual Images, User Profiles @@ -1409,6 +1409,12 @@ Consider all listed sites to potentially be NSFW. Posts, Tag Searches + + Snootbooru + https://snootbooru.com/ + Posts, Tag Searches + + URL Shorteners diff --git a/gallery_dl/extractor/szurubooru.py b/gallery_dl/extractor/szurubooru.py index 5415bf30..08cccab6 100644 --- a/gallery_dl/extractor/szurubooru.py +++ b/gallery_dl/extractor/szurubooru.py @@ -87,6 +87,10 @@ BASE_PATTERN = SzurubooruExtractor.update({ "root": "https://booru.bcbnsfw.space", "pattern": r"booru\.bcbnsfw\.space", }, + "snootbooru": { + "root": "https://snootbooru.com", + "pattern": r"snootbooru\.com", + }, }) diff --git a/test/results/snootbooru.py b/test/results/snootbooru.py new file mode 100644 index 00000000..822bad6e --- /dev/null +++ b/test/results/snootbooru.py @@ -0,0 +1,79 @@ +# -*- 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 szurubooru + + +__tests__ = ( +{ + "#url" : "https://snootbooru.com/posts/query=sport", + "#category": ("szurubooru", "snootbooru", "tag"), + "#class" : szurubooru.SzurubooruTagExtractor, + "#pattern" : r"https://snootbooru\.com/data/posts/\d+_[0-9a-f]{16}\.\w+", + "#count" : range(35, 50), +}, + +{ + "#url" : "https://snootbooru.com/post/14511", + "#category": ("szurubooru", "snootbooru", "post"), + "#class" : szurubooru.SzurubooruPostExtractor, + "#urls" : "https://snootbooru.com/data/posts/14511_e753313112755da6.png", + "#sha1_content": "e69e61e61c5372514808480aae3a8e355c9cd6fb", + + "canvasHeight" : 1000, + "canvasWidth" : 1414, + "checksum" : "e69e61e61c5372514808480aae3a8e355c9cd6fb", + "checksumMD5" : "f4f4ddfcbdf367f466ede0980acb3d7d", + "commentCount" : int, + "comments" : list, + "contentUrl" : "data/posts/14511_e753313112755da6.png", + "creationTime" : "2023-12-02T01:11:01.433664Z", + "date" : "dt:2023-12-02 01:11:01", + "extension" : "png", + "favoriteCount": int, + "favoritedBy" : list, + "featureCount" : int, + "fileSize" : 270639, + "filename" : "14511_e753313112755da6", + "flags" : [], + "hasCustomThumbnail": False, + "id" : 14511, + "lastEditTime" : "2023-12-02T01:12:09.500217Z", + "lastFeatureTime": None, + "mimeType" : "image/png", + "noteCount" : 0, + "notes" : [], + "ownFavorite" : False, + "ownScore" : 0, + "pools" : [], + "relationCount": 0, + "relations" : [], + "safety" : "safe", + "score" : 0, + "source" : None, + "tagCount" : 3, + "tags" : [ + "transparent", + "sport", + "text", + ], + "tags_default" : [ + "sport", + "text" + ], + "tags_type" : [ + "transparent" + ], + "thumbnailUrl" : "data/generated-thumbnails/14511_e753313112755da6.jpg", + "type" : "image", + "user" : { + "avatarUrl": "data/avatars/komp.png", + "name": "komp" + }, + "version" : 2, +}, + +)