1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[mastodon] add 'reblogs' option (#1669)

This commit is contained in:
Mike Fährmann 2021-07-06 23:13:58 +02:00
parent 317ecc8180
commit a1f5b78039
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 16 additions and 0 deletions

View File

@ -1269,6 +1269,16 @@ Description
Provide ``artist``, ``author``, and ``group`` metadata fields.
extractor.mastodon.reblogs
--------------------------
Type
``bool``
Default
``false``
Description
Extract media from reblogged posts.
extractor.mastodon.text-posts
-----------------------------
Type

View File

@ -27,7 +27,13 @@ class MastodonExtractor(BaseExtractor):
self.item = match.group(match.lastindex)
def items(self):
reblogs = self.config("reblogs", False)
for status in self.statuses():
if not reblogs and status["reblog"]:
self.log.debug("Skipping %s (reblog)", status["id"])
continue
attachments = status["media_attachments"]
del status["media_attachments"]