summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/paheal.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-03-25 02:57:44 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2024-03-25 02:57:44 -0400
commit6e662211019a89caec44de8a57c675872b0b5498 (patch)
tree5d9d5a2b7efc3a24dd6074e99b253b639fe5af1d /gallery_dl/extractor/paheal.py
parent01166fa52707cc282467427cf0e65c1b8983c4be (diff)
New upstream version 1.26.9.upstream/1.26.9
Diffstat (limited to 'gallery_dl/extractor/paheal.py')
-rw-r--r--gallery_dl/extractor/paheal.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/gallery_dl/extractor/paheal.py b/gallery_dl/extractor/paheal.py
index 5226724..b21e1eb 100644
--- a/gallery_dl/extractor/paheal.py
+++ b/gallery_dl/extractor/paheal.py
@@ -26,13 +26,13 @@ class PahealExtractor(Extractor):
data = self.get_metadata()
for post in self.get_posts():
- url = post["file_url"]
- for key in ("id", "width", "height"):
- post[key] = text.parse_int(post[key])
+ post["id"] = text.parse_int(post["id"])
post["tags"] = text.unquote(post["tags"])
+ post["width"] = text.parse_int(post["width"])
+ post["height"] = text.parse_int(post["height"])
post.update(data)
yield Message.Directory, post
- yield Message.Url, url, post
+ yield Message.Url, post["file_url"], post
def get_metadata(self):
"""Return general metadata"""
@@ -114,17 +114,19 @@ class PahealTagExtractor(PahealExtractor):
tags, data, date = data.split("\n")
dimensions, size, ext = data.split(" // ")
- tags = text.unescape(tags)
width, _, height = dimensions.partition("x")
height, _, duration = height.partition(", ")
return {
- "id": pid, "md5": md5, "file_url": url,
- "width": width, "height": height,
- "duration": text.parse_float(duration[:-1]),
- "tags": tags,
- "size": text.parse_bytes(size[:-1]),
- "date": text.parse_datetime(date, "%B %d, %Y; %H:%M"),
+ "id" : pid,
+ "md5" : md5,
+ "file_url" : url,
+ "width" : width,
+ "height" : height,
+ "duration" : text.parse_float(duration[:-1]),
+ "tags" : text.unescape(tags),
+ "size" : text.parse_bytes(size[:-1]),
+ "date" : text.parse_datetime(date, "%B %d, %Y; %H:%M"),
"filename" : "{} - {}".format(pid, tags),
"extension": ext,
}