aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/patreon.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/patreon.py')
-rw-r--r--gallery_dl/extractor/patreon.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/gallery_dl/extractor/patreon.py b/gallery_dl/extractor/patreon.py
index 839e0b8..9c32d7a 100644
--- a/gallery_dl/extractor/patreon.py
+++ b/gallery_dl/extractor/patreon.py
@@ -117,12 +117,22 @@ class PatreonExtractor(Extractor):
attr = post["attributes"]
attr["id"] = text.parse_int(post["id"])
- if post.get("current_user_can_view", True):
+ if attr.get("current_user_can_view", True):
+
+ relationships = post["relationships"]
attr["images"] = self._files(post, included, "images")
attr["attachments"] = self._files(post, included, "attachments")
attr["date"] = text.parse_datetime(
attr["published_at"], "%Y-%m-%dT%H:%M:%S.%f%z")
- user = post["relationships"]["user"]
+
+ tags = relationships.get("user_defined_tags")
+ attr["tags"] = [
+ tag["id"].replace("user_defined;", "")
+ for tag in tags["data"]
+ if tag["type"] == "post_tag"
+ ] if tags else []
+
+ user = relationships["user"]
attr["creator"] = (
self._user(user["links"]["related"]) or
included["user"][user["data"]["id"]])
@@ -299,6 +309,10 @@ class PatreonPostExtractor(PatreonExtractor):
("https://www.patreon.com/posts/19987002", {
"count": 4,
}),
+ # tags (#1539)
+ ("https://www.patreon.com/posts/free-post-12497641", {
+ "keyword": {"tags": ["AWMedia"]},
+ }),
("https://www.patreon.com/posts/not-found-123", {
"exception": exception.NotFoundError,
}),