diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 9ef1fd09..e3b4ea7e 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -400,7 +400,7 @@ Consider all listed sites to potentially be NSFW. Inkbunny https://inkbunny.net/ - Favorites, Followed Users, Pools, Posts, Search Results, User Profiles + Favorites, Followed Users, Pools, Posts, Search Results, Unread Submissions, User Profiles Supported diff --git a/gallery_dl/extractor/inkbunny.py b/gallery_dl/extractor/inkbunny.py index 7076dfec..c52e3570 100644 --- a/gallery_dl/extractor/inkbunny.py +++ b/gallery_dl/extractor/inkbunny.py @@ -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" diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py index a0856f00..2a625e76 100755 --- a/scripts/supportedsites.py +++ b/scripts/supportedsites.py @@ -192,6 +192,9 @@ SUBCATEGORY_MAP = { "imgur": { "favorite-folder": "Favorites Folders", }, + "inkbunny": { + "unread": "Unread Submissions", + }, "instagram": { "posts": "", "saved": "Saved Posts", diff --git a/test/results/inkbunny.py b/test/results/inkbunny.py index 7129877e..58cecb68 100644 --- a/test/results/inkbunny.py +++ b/test/results/inkbunny.py @@ -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"),