diff options
| author | 2025-04-27 20:34:08 -0400 | |
|---|---|---|
| committer | 2025-04-27 20:34:08 -0400 | |
| commit | 4a18b5837c1dd82f5964afcfc3fecc53cd97e79c (patch) | |
| tree | 44019190a44fd449daa0efd07c65bbe524688c33 /gallery_dl/extractor/postmill.py | |
| parent | b830dc03b3b7c9dd119648e1be9c1145d56e096c (diff) | |
New upstream version 1.29.5.upstream/1.29.5
Diffstat (limited to 'gallery_dl/extractor/postmill.py')
| -rw-r--r-- | gallery_dl/extractor/postmill.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gallery_dl/extractor/postmill.py b/gallery_dl/extractor/postmill.py index 8877175..6ea18e6 100644 --- a/gallery_dl/extractor/postmill.py +++ b/gallery_dl/extractor/postmill.py @@ -153,17 +153,13 @@ class PostmillPostExtractor(PostmillExtractor): class PostmillShortURLExtractor(PostmillExtractor): """Extractor for short submission URLs""" subcategory = "shorturl" - pattern = BASE_PATTERN + r"/(\d+)$" + pattern = BASE_PATTERN + r"(/\d+)$" example = "https://raddle.me/123" - def __init__(self, match): - PostmillExtractor.__init__(self, match) - self.post_id = match.group(3) - def items(self): - url = self.root + "/" + self.post_id - response = self.request(url, method="HEAD", allow_redirects=False) - full_url = text.urljoin(url, response.headers["Location"]) + url = self.root + self.groups[2] + location = self.request_location(url) + full_url = text.urljoin(url, location) yield Message.Queue, full_url, {"_extractor": PostmillPostExtractor} |
