[patreon] extract 'attachments_media' files (#6241)

https://github.com/mikf/gallery-dl/issues/6241#issuecomment-2386343160
This commit is contained in:
Mike Fährmann
2024-10-01 19:41:26 +02:00
parent b03ee3c4c4
commit fb6be2dd34
2 changed files with 22 additions and 2 deletions

View File

@@ -100,6 +100,11 @@ class PatreonExtractor(Extractor):
if url:
yield "attachment", url, attachment["name"]
for attachment in post.get("attachments_media") or ():
url = attachment.get("download_url")
if url:
yield "attachment", url, attachment["file_name"]
def _content(self, post):
content = post.get("content")
if content:
@@ -138,8 +143,12 @@ class PatreonExtractor(Extractor):
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["images"] = self._files(
post, included, "images")
attr["attachments"] = self._files(
post, included, "attachments")
attr["attachments_media"] = self._files(
post, included, "attachments_media")
attr["date"] = text.parse_datetime(
attr["published_at"], "%Y-%m-%dT%H:%M:%S.%f%z")