diff options
| author | 2020-12-13 23:07:42 -0500 | |
|---|---|---|
| committer | 2020-12-13 23:07:42 -0500 | |
| commit | 8f7c87a2697113134c311aaeafd9c919555a2741 (patch) | |
| tree | 4ff7316ac1570683b3c968fd30d044925e47a2a5 /gallery_dl/extractor/paheal.py | |
| parent | 143723944033d7a6593d57bd1cf6ae97713b6ce7 (diff) | |
New upstream version 1.16.0.upstream/1.16.0
Diffstat (limited to 'gallery_dl/extractor/paheal.py')
| -rw-r--r-- | gallery_dl/extractor/paheal.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gallery_dl/extractor/paheal.py b/gallery_dl/extractor/paheal.py index e0b0496..abcc33d 100644 --- a/gallery_dl/extractor/paheal.py +++ b/gallery_dl/extractor/paheal.py @@ -6,13 +6,13 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -"""Extract images from https://rule34.paheal.net/""" +"""Extractors for https://rule34.paheal.net/""" -from .common import Extractor, Message, SharedConfigMixin +from .common import Extractor, Message from .. import text -class PahealExtractor(SharedConfigMixin, Extractor): +class PahealExtractor(Extractor): """Base class for paheal extractors""" basecategory = "booru" category = "paheal" @@ -23,16 +23,16 @@ class PahealExtractor(SharedConfigMixin, Extractor): def items(self): self.session.cookies.set( "ui-tnc-agreed", "true", domain="rule34.paheal.net") + data = self.get_metadata() - yield Message.Version, 1 - yield Message.Directory, self.get_metadata() - - for data in self.get_posts(): - url = data["file_url"] + for post in self.get_posts(): + url = post["file_url"] for key in ("id", "width", "height"): - data[key] = text.parse_int(data[key]) - data["tags"] = text.unquote(data["tags"]) - yield Message.Url, url, text.nameext_from_url(url, data) + post[key] = text.parse_int(post[key]) + post["tags"] = text.unquote(post["tags"]) + post.update(data) + yield Message.Directory, post + yield Message.Url, url, text.nameext_from_url(url, post) def get_metadata(self): """Return general metadata""" @@ -100,7 +100,7 @@ class PahealPostExtractor(PahealExtractor): r"/post/view/(\d+)") test = ("https://rule34.paheal.net/post/view/481609", { "url": "a91d579be030753282f55b8cb4eeaa89c45a9116", - "keyword": "44154bdac3d6cf289d0d9739a566acd8b7839e50", + "keyword": "e02e4dcf8cdf4e9c206e695253c9024d79a2e20a", "content": "7b924bcf150b352ac75c9d281d061e174c851a11", }) |
