Skip to content

Commit

Permalink
[szurubooru] support 'snootbooru.com' (#5023)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 5, 2024
1 parent b4bcf40 commit e61f016
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ Consider all listed sites to potentially be NSFW.
</tr>
<tr>
<td>JPG Fish</td>
<td>https://jpg2.su/</td>
<td>https://jpg4.su/</td>
<td>Albums, individual Images, User Profiles</td>
<td></td>
</tr>
Expand Down Expand Up @@ -1409,6 +1409,12 @@ Consider all listed sites to potentially be NSFW.
<td>Posts, Tag Searches</td>
<td></td>
</tr>
<tr>
<td>Snootbooru</td>
<td>https://snootbooru.com/</td>
<td>Posts, Tag Searches</td>
<td></td>
</tr>

<tr>
<td colspan="4"><strong>URL Shorteners</strong></td>
Expand Down
4 changes: 4 additions & 0 deletions gallery_dl/extractor/szurubooru.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def _prepare(post):
"root": "https://booru.bcbnsfw.space",
"pattern": r"booru\.bcbnsfw\.space",
},
"snootbooru": {
"root": "https://snootbooru.com",
"pattern": r"snootbooru\.com",
},
})


Expand Down
79 changes: 79 additions & 0 deletions test/results/snootbooru.py
Original file line number Diff line number Diff line change
@@ -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,
},

)

0 comments on commit e61f016

Please sign in to comment.