aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/furaffinity.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/furaffinity.py')
-rw-r--r--gallery_dl/extractor/furaffinity.py40
1 files changed, 32 insertions, 8 deletions
diff --git a/gallery_dl/extractor/furaffinity.py b/gallery_dl/extractor/furaffinity.py
index f48a984..3055426 100644
--- a/gallery_dl/extractor/furaffinity.py
+++ b/gallery_dl/extractor/furaffinity.py
@@ -78,14 +78,12 @@ class FuraffinityExtractor(Extractor):
path = extr('href="//d', '"')
if not path:
- self.log.warning(
- "Unable to download post %s (\"%s\")",
- post_id, text.remove_html(
- extr('System Message', '</section>') or
- extr('System Message', '</table>')
- )
- )
- return None
+ msg = text.remove_html(
+ extr('System Message', '</section>') or
+ extr('System Message', '</table>')
+ ).partition(" . Continue ")[0]
+ return self.log.warning(
+ "Unable to download post %s (\"%s\")", post_id, msg)
pi = text.parse_int
rh = text.remove_html
@@ -335,3 +333,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, '<a class="button standard more" href="', '"') or # noqa 501
+ text.extr(page, '<a class="more-half" href="', '"') or
+ text.extr(page, '<a class="more" href="', '"'))
+ if not path:
+ return
+ url = self.root + text.unescape(path)