summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/paheal.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-01-08 03:22:24 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2024-01-08 03:22:24 -0500
commite949aaf6f6ac93896947d5b736e48e7911926efb (patch)
treeb73090d78cd83dee0f85b385a25dcf623ac12f2d /gallery_dl/extractor/paheal.py
parent4d7a4f1ecef2c96269f3590335d2834ebcdd50bf (diff)
New upstream version 1.26.6.upstream/1.26.6
Diffstat (limited to 'gallery_dl/extractor/paheal.py')
-rw-r--r--gallery_dl/extractor/paheal.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/gallery_dl/extractor/paheal.py b/gallery_dl/extractor/paheal.py
index 0389ead..89c0d2f 100644
--- a/gallery_dl/extractor/paheal.py
+++ b/gallery_dl/extractor/paheal.py
@@ -32,7 +32,7 @@ class PahealExtractor(Extractor):
post["tags"] = text.unquote(post["tags"])
post.update(data)
yield Message.Directory, post
- yield Message.Url, url, text.nameext_from_url(url, post)
+ yield Message.Url, url, post
def get_metadata(self):
"""Return general metadata"""
@@ -59,11 +59,13 @@ class PahealExtractor(Extractor):
extr(">Source&nbsp;Link<", "</td>"), "href='", "'")),
}
- dimensions, size, ext = extr("Info</th><td>", ">").split(" // ")
- post["width"], _, height = dimensions.partition("x")
+ dimensions, size, ext = extr("Info</th><td>", "<").split(" // ")
post["size"] = text.parse_bytes(size[:-1])
+ post["width"], _, height = dimensions.partition("x")
post["height"], _, duration = height.partition(", ")
post["duration"] = text.parse_float(duration[:-1])
+ post["filename"] = "{} - {}".format(post_id, post["tags"])
+ post["extension"] = ext
return post
@@ -112,6 +114,7 @@ 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(", ")
@@ -119,9 +122,11 @@ class PahealTagExtractor(PahealExtractor):
"id": pid, "md5": md5, "file_url": url,
"width": width, "height": height,
"duration": text.parse_float(duration[:-1]),
- "tags": text.unescape(tags),
+ "tags": tags,
"size": text.parse_bytes(size[:-1]),
"date": text.parse_datetime(date, "%B %d, %Y; %H:%M"),
+ "filename" : "{} - {}".format(pid, tags),
+ "extension": ext,
}
def _extract_data_ex(self, post):