diff --git a/docs/supportedsites.md b/docs/supportedsites.md
index 55840c70..f7450a8c 100644
--- a/docs/supportedsites.md
+++ b/docs/supportedsites.md
@@ -586,7 +586,7 @@ Consider all sites to be NSFW unless otherwise known.
| Pinterest |
https://www.pinterest.com/ |
- Pins, pin.it Links, related Pins, Search Results, Sections, User Profiles |
+ Created Pins, Pins, pin.it Links, related Pins, Search Results, Sections, User Profiles |
Cookies |
diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py
index 466bbe85..55938976 100644
--- a/gallery_dl/extractor/pinterest.py
+++ b/gallery_dl/extractor/pinterest.py
@@ -123,7 +123,8 @@ class PinterestBoardExtractor(PinterestExtractor):
subcategory = "board"
directory_fmt = ("{category}", "{board[owner][username]}", "{board[name]}")
archive_fmt = "{board[id]}_{id}"
- pattern = BASE_PATTERN + r"/(?!pin/)([^/?#&]+)/(?!_saved)([^/?#&]+)/?$"
+ pattern = (BASE_PATTERN + r"/(?!pin/)([^/?#&]+)"
+ "/(?!_saved|_created)([^/?#&]+)/?$")
test = (
("https://www.pinterest.com/g1952849/test-/", {
"pattern": r"https://i\.pinimg\.com/originals/",
@@ -191,6 +192,28 @@ class PinterestUserExtractor(PinterestExtractor):
yield Message.Queue, self.root + url, board
+class PinterestCreatedExtractor(PinterestExtractor):
+ """Extractor for a user's created pins"""
+ subcategory = "created"
+ directory_fmt = ("{category}", "{user}")
+ pattern = BASE_PATTERN + r"/(?!pin/)([^/?#&]+)/_created/?$"
+ test = ("https://www.pinterest.com/amazon/_created", {
+ "pattern": r"https://i\.pinimg\.com/originals/[0-9a-f]{2}"
+ r"/[0-9a-f]{2}/[0-9a-f]{2}/[0-9a-f]{32}\.jpg",
+ "count": 2,
+ })
+
+ def __init__(self, match):
+ PinterestExtractor.__init__(self, match)
+ self.user = text.unquote(match.group(1))
+
+ def metadata(self):
+ return {"user": self.user}
+
+ def pins(self):
+ return self.api.user_activity_pins(self.user)
+
+
class PinterestSectionExtractor(PinterestExtractor):
"""Extractor for board sections on pinterest.com"""
subcategory = "section"
@@ -384,6 +407,16 @@ class PinterestAPI():
options = {"board_id": board_id, "add_vase": True}
return self._pagination("BoardRelatedPixieFeed", options)
+ def user_activity_pins(self, user):
+ """Yield pins created by 'user'"""
+ options = {
+ "exclude_add_pin_rep": True,
+ "field_set_key" : "grid_item",
+ "is_own_profile_pins": False,
+ "username" : user,
+ }
+ return self._pagination("UserActivityPins", options)
+
def search(self, query):
"""Yield pins from searches"""
options = {"query": query, "scope": "pins", "rs": "typed"}
diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py
index 3a08a399..a293db95 100755
--- a/scripts/supportedsites.py
+++ b/scripts/supportedsites.py
@@ -180,6 +180,7 @@ SUBCATEGORY_MAP = {
"pinterest": {
"board": "",
"pinit": "pin.it Links",
+ "created": "Created Pins",
},
"pixiv": {
"me" : "pixiv.me Links",