aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/pinterest.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-04-27 20:34:08 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-04-27 20:34:08 -0400
commit4a18b5837c1dd82f5964afcfc3fecc53cd97e79c (patch)
tree44019190a44fd449daa0efd07c65bbe524688c33 /gallery_dl/extractor/pinterest.py
parentb830dc03b3b7c9dd119648e1be9c1145d56e096c (diff)
New upstream version 1.29.5.upstream/1.29.5
Diffstat (limited to 'gallery_dl/extractor/pinterest.py')
-rw-r--r--gallery_dl/extractor/pinterest.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py
index 1a299c1..ad8c681 100644
--- a/gallery_dl/extractor/pinterest.py
+++ b/gallery_dl/extractor/pinterest.py
@@ -380,15 +380,10 @@ class PinterestPinitExtractor(PinterestExtractor):
pattern = r"(?:https?://)?pin\.it/([^/?#]+)"
example = "https://pin.it/abcde"
- def __init__(self, match):
- PinterestExtractor.__init__(self, match)
- self.shortened_id = match.group(1)
-
def items(self):
url = "https://api.pinterest.com/url_shortener/{}/redirect/".format(
- self.shortened_id)
- response = self.request(url, method="HEAD", allow_redirects=False)
- location = response.headers.get("Location")
+ self.groups[0])
+ location = self.request_location(url)
if not location or not PinterestPinExtractor.pattern.match(location):
raise exception.NotFoundError("pin")
yield Message.Queue, location, {"_extractor": PinterestPinExtractor}