From 846512f6cd9d5be1019638fab299b8d4b6c4c914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 7 Aug 2024 16:28:40 +0200 Subject: [PATCH] [furaffinity] add 'submissions' extractor (#5954) --- docs/supportedsites.md | 2 +- gallery_dl/extractor/furaffinity.py | 26 ++++++++++++++++++++++++++ scripts/supportedsites.py | 3 +++ test/results/furaffinity.py | 17 +++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 18f66dd3..1e945926 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -250,7 +250,7 @@ Consider all listed sites to potentially be NSFW. Fur Affinity https://www.furaffinity.net/ - Favorites, Followed Users, Galleries, Posts, Scraps, Search Results, User Profiles + Favorites, Followed Users, Galleries, Posts, Scraps, Search Results, New Submissions, User Profiles Cookies diff --git a/gallery_dl/extractor/furaffinity.py b/gallery_dl/extractor/furaffinity.py index f48a9844..b2e7d3cb 100644 --- a/gallery_dl/extractor/furaffinity.py +++ b/gallery_dl/extractor/furaffinity.py @@ -335,3 +335,29 @@ class FuraffinityFollowingExtractor(FuraffinityExtractor): if url.endswith(path): return url = self.root + path + + +class FuraffinitySubmissionsExtractor(FuraffinityExtractor): + """Extractor for new furaffinity submissions""" + subcategory = "submissions" + pattern = BASE_PATTERN + r"(/msg/submissions(?:/[^/?#]+)?)" + example = "https://www.furaffinity.net/msg/submissions" + + def posts(self): + self.user = None + url = self.root + self.groups[0] + return self._pagination_submissions(url) + + def _pagination_submissions(self, url): + while True: + page = self.request(url).text + + for post_id in text.extract_iter(page, 'id="sid-', '"'): + yield post_id + + path = (text.extr(page, '