diff --git a/docs/configuration.rst b/docs/configuration.rst index 837db6cd78..8b4de49841 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1899,6 +1899,9 @@ Default Description Fetch media from replies to other Tweets. + If this value is ``"self"``, only consider replies where + reply and original Tweet are from the same user. + extractor.twitter.retweets -------------------------- diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index af79525282..c497ef8dd4 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -50,12 +50,17 @@ def items(self): if not self.retweets and "retweeted_status_id_str" in tweet: self.log.debug("Skipping %s (retweet)", tweet["id_str"]) continue - if not self.replies and "in_reply_to_user_id_str" in tweet: - self.log.debug("Skipping %s (reply)", tweet["id_str"]) - continue if not self.quoted and "quoted" in tweet: self.log.debug("Skipping %s (quoted tweet)", tweet["id_str"]) continue + if "in_reply_to_user_id_str" in tweet and ( + not self.replies or ( + self.replies == "self" and + tweet["in_reply_to_user_id_str"] != tweet["user_id_str"] + ) + ): + self.log.debug("Skipping %s (reply)", tweet["id_str"]) + continue files = [] if "extended_entities" in tweet: @@ -452,6 +457,15 @@ class TwitterTweetExtractor(TwitterExtractor): "options": (("replies", False),), "count": 0, }), + # 'replies' to self (#1254) + ("https://twitter.com/i/web/status/1424882930803908612", { + "options": (("replies", "self"),), + "count": 4, + }), + ("https://twitter.com/i/web/status/1424898916156284928", { + "options": (("replies", "self"),), + "count": 0, + }), # "quoted" option (#854) ("https://twitter.com/StobiesGalaxy/status/1270755918330896395", { "options": (("quoted", True),),