[patreon] get partial user info without /api/user/<id> (#507)

It's a lot less data, but doesn't invoke any additional
HTTP requests with potential Cloudflare CAPTCHAs.
This commit is contained in:
Mike Fährmann 2019-12-09 20:38:05 +01:00
parent 0ab9bb1721
commit c9ef1b21c3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -97,8 +97,8 @@ class PatreonExtractor(Extractor):
attr["attachments"] = self._files(post, included, "attachments")
attr["date"] = text.parse_datetime(
attr["published_at"], "%Y-%m-%dT%H:%M:%S.%f%z")
attr["creator"] = self._user(
post["relationships"]["user"]["links"]["related"])
uid = post["relationships"]["user"]["data"]["id"]
attr["creator"] = included["user"][uid]
return attr
@staticmethod