diff --git a/gallery_dl/extractor/patreon.py b/gallery_dl/extractor/patreon.py index b04ee4d2..52454ec9 100644 --- a/gallery_dl/extractor/patreon.py +++ b/gallery_dl/extractor/patreon.py @@ -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") diff --git a/test/results/patreon.py b/test/results/patreon.py index aa864369..b8fc1bb2 100644 --- a/test/results/patreon.py +++ b/test/results/patreon.py @@ -75,6 +75,17 @@ __tests__ = ( "#count" : 4, }, +{ + "#url" : "https://www.patreon.com/posts/free-mari-8s-113049301", + "#comment" : "postfile + attachments_media (#6241)", + "#class" : patreon.PatreonPostExtractor, + "#pattern" : [ + r"https://c10\.patreonusercontent\.com/4/patreon-media/p/post/113049301/7ae4fd78d3374d849a80863f3d8eee89/eyJhIjoxLCJwIjoxfQ%3D%3D/1\.jpg", + r"https://c10\.patreonusercontent\.com/4/patreon-media/p/post/113049301/b6ea96b18cbc47f78f9334d50d0877ea/eyJhIjoxLCJwIjoxfQ%3D%3D/1\.mp4", + r"https://c10\.patreonusercontent\.com/4/patreon-media/p/post/113049301/62dc1d4194db4245aca31c56f71234ed/eyJhIjoxLCJwIjoxfQ%3D%3D/1\.mp4", + ], +}, + { "#url" : "https://www.patreon.com/posts/56127163", "#comment" : "account suspended",