summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/patreon.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-02-16 21:35:52 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-02-16 21:35:52 -0500
commitfc83315c164afd74734adf27e0f7fec2011904aa (patch)
treed5976be93924dc4cd76c41e5e3f13bb44b6516b3 /gallery_dl/extractor/patreon.py
parent2e29d2158d56879e5578dfabf9e8c0fa2e855ccf (diff)
New upstream version 1.16.5.upstream/1.16.5
Diffstat (limited to 'gallery_dl/extractor/patreon.py')
-rw-r--r--gallery_dl/extractor/patreon.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/gallery_dl/extractor/patreon.py b/gallery_dl/extractor/patreon.py
index ad259f4..688c005 100644
--- a/gallery_dl/extractor/patreon.py
+++ b/gallery_dl/extractor/patreon.py
@@ -34,6 +34,10 @@ class PatreonExtractor(Extractor):
PatreonExtractor._warning = False
for post in self.posts():
+
+ if not post.get("current_user_can_view", True):
+ self.log.warning("Not allowed to view post %s", post["id"])
+ continue
post["num"] = 0
hashes = set()
@@ -113,14 +117,17 @@ class PatreonExtractor(Extractor):
"""Process and extend a 'post' object"""
attr = post["attributes"]
attr["id"] = text.parse_int(post["id"])
- 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"]
- attr["creator"] = (
- self._user(user["links"]["related"]) or
- included["user"][user["data"]["id"]])
+
+ if post.get("current_user_can_view", True):
+ 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"]
+ attr["creator"] = (
+ self._user(user["links"]["related"]) or
+ included["user"][user["data"]["id"]])
+
return attr
@staticmethod