diff --git a/docs/configuration.rst b/docs/configuration.rst index 2c227074..ead93233 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1761,6 +1761,18 @@ Description port than the default. +extractor.paheal.metadata +------------------------- +Type + ``bool`` +Default + ``false`` +Description + Extract additional metadata (``source``, ``uploader``) + + Note: This requires 1 additional HTTP request per post. + + extractor.patreon.files ----------------------- Type diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 4c42df9b..cf719494 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -195,6 +195,10 @@ "cache": true, "port": 6414 }, + "paheal": + { + "metadata": false + }, "pillowfort": { "external": false, diff --git a/gallery_dl/extractor/paheal.py b/gallery_dl/extractor/paheal.py index 745837b3..0a6a6d3c 100644 --- a/gallery_dl/extractor/paheal.py +++ b/gallery_dl/extractor/paheal.py @@ -62,7 +62,7 @@ class PahealExtractor(Extractor): post["width"], _, post["height"] = dimensions.partition("x") post["size"] = text.parse_bytes(size[:-1]) - return (post,) + return post class PahealTagExtractor(PahealExtractor): @@ -81,6 +81,9 @@ class PahealTagExtractor(PahealExtractor): PahealExtractor.__init__(self, match) self.tags = text.unquote(match.group(1)) + if self.config("metadata"): + self._extract_data = self._extract_data_ex + def get_metadata(self): return {"search_tags": self.tags} @@ -114,8 +117,13 @@ class PahealTagExtractor(PahealExtractor): "width": width, "height": height, "tags": text.unescape(tags), "size": text.parse_bytes(size[:-1]), + "date": text.parse_datetime(date, "%B %d, %Y; %H:%M"), } + def _extract_data_ex(self, post): + pid = post[:post.index('"')] + return self._extract_post(pid) + class PahealPostExtractor(PahealExtractor): """Extractor for single images from rule34.paheal.net""" @@ -162,4 +170,4 @@ class PahealPostExtractor(PahealExtractor): self.post_id = match.group(1) def get_posts(self): - return self._extract_post(self.post_id) + return (self._extract_post(self.post_id),)