diff options
| author | 2021-06-05 20:55:36 -0400 | |
|---|---|---|
| committer | 2021-06-05 20:55:36 -0400 | |
| commit | 8a644b7a06c504263a478d3681eed10b4161b5be (patch) | |
| tree | b3d668588e5c0be8c75467e50499f73ff9ec7c05 /gallery_dl/extractor/patreon.py | |
| parent | e7eb1f9779f2e223575ab23a6bc1abf2222e7d27 (diff) | |
New upstream version 1.17.5.upstream/1.17.5
Diffstat (limited to 'gallery_dl/extractor/patreon.py')
| -rw-r--r-- | gallery_dl/extractor/patreon.py | 18 |
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, }), |
