1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[inkbunny] add 'unread' extractor (#4934)

This commit is contained in:
Mike Fährmann 2023-12-15 21:20:12 +01:00
parent 8b87a5330d
commit 2852404e49
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
4 changed files with 30 additions and 1 deletions

View File

@ -400,7 +400,7 @@ Consider all listed sites to potentially be NSFW.
<tr>
<td>Inkbunny</td>
<td>https://inkbunny.net/</td>
<td>Favorites, Followed Users, Pools, Posts, Search Results, User Profiles</td>
<td>Favorites, Followed Users, Pools, Posts, Search Results, Unread Submissions, User Profiles</td>
<td>Supported</td>
</tr>
<tr>

View File

@ -161,6 +161,26 @@ class InkbunnyFavoriteExtractor(InkbunnyExtractor):
return self.api.search(params)
class InkbunnyUnreadExtractor(InkbunnyExtractor):
"""Extractor for unread inkbunny submissions"""
subcategory = "unread"
pattern = (BASE_PATTERN +
r"/submissionsviewall\.php\?([^#]+&mode=unreadsubs&[^#]+)")
example = ("https://inkbunny.net/submissionsviewall.php"
"?text=&mode=unreadsubs&type=")
def __init__(self, match):
InkbunnyExtractor.__init__(self, match)
self.params = text.parse_query(match.group(1))
def posts(self):
params = self.params.copy()
params.pop("rid", None)
params.pop("mode", None)
params["unread_submissions"] = "yes"
return self.api.search(params)
class InkbunnySearchExtractor(InkbunnyExtractor):
"""Extractor for inkbunny search results"""
subcategory = "search"

View File

@ -192,6 +192,9 @@ SUBCATEGORY_MAP = {
"imgur": {
"favorite-folder": "Favorites Folders",
},
"inkbunny": {
"unread": "Unread Submissions",
},
"instagram": {
"posts": "",
"saved": "Saved Posts",

View File

@ -94,6 +94,12 @@ __tests__ = (
"#class" : inkbunny.InkbunnyFavoriteExtractor,
},
{
"#url" : "https://inkbunny.net/submissionsviewall.php?rid=ffffffffff&mode=unreadsubs&page=1&orderby=unread_datetime",
"#category": ("", "inkbunny", "unread"),
"#class" : inkbunny.InkbunnyUnreadExtractor,
},
{
"#url" : "https://inkbunny.net/submissionsviewall.php?rid=ffffffffff&mode=search&page=1&orderby=create_datetime&text=cute&stringtype=and&keywords=yes&title=yes&description=no&artist=&favsby=&type=&days=&keyword_id=&user_id=&random=&md5=",
"#category": ("", "inkbunny", "search"),