From a751afdfb37eb2b1ce376eabe1ed3fe15c620b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 11 Jun 2021 21:19:04 +0200 Subject: [PATCH] [twitter] change some defaults - 'retweets' option: true -> false - 'quoted' option : true -> false i.e. disable downloading tweets from other user's timelines by default - search directory: '["{category}", "Search", "{search}"]' -> '["{category}", "{user[name]}"]' i.e. change it to the same as other twitter extractors (#1308) --- docs/configuration.rst | 4 ++-- docs/gallery-dl.conf | 4 ++-- gallery_dl/extractor/twitter.py | 13 ++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index bd1b5996..02b9340f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1715,7 +1715,7 @@ extractor.twitter.quoted Type ``bool`` Default - ``true`` + ``false`` Description Fetch media from quoted Tweets. @@ -1735,7 +1735,7 @@ extractor.twitter.retweets Type ``bool`` Default - ``true`` + ``false`` Description Fetch media from Retweets. diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 7497cd65..9514c7aa 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -256,9 +256,9 @@ "password": null, "cards": false, "conversations": false, - "quoted": true, + "quoted": false, "replies": true, - "retweets": true, + "retweets": false, "text-tweets": false, "twitpic": false, "users": "timeline", diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index afeebb09..5550f966 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -33,10 +33,10 @@ class TwitterExtractor(Extractor): Extractor.__init__(self, match) self.user = match.group(1) self.textonly = self.config("text-tweets", False) - self.retweets = self.config("retweets", True) + self.retweets = self.config("retweets", False) self.replies = self.config("replies", True) self.twitpic = self.config("twitpic", False) - self.quoted = self.config("quoted", True) + self.quoted = self.config("quoted", False) self.videos = self.config("videos", True) self.cards = self.config("cards", False) self._user_cache = {} @@ -44,7 +44,6 @@ class TwitterExtractor(Extractor): def items(self): self.login() metadata = self.metadata() - yield Message.Version, 1 for tweet in self.tweets(): @@ -406,7 +405,6 @@ class TwitterFollowingExtractor(TwitterExtractor): class TwitterSearchExtractor(TwitterExtractor): """Extractor for all images from a search timeline""" subcategory = "search" - directory_fmt = ("{category}", "Search", "{search}") pattern = BASE_PATTERN + r"/search/?\?(?:[^&#]+&)*q=([^&#]+)" test = ("https://twitter.com/search?q=nature", { "range": "1-40", @@ -456,14 +454,14 @@ class TwitterTweetExtractor(TwitterExtractor): "options": (("replies", False),), "count": 0, }), - # quoted tweet (#526, #854) + # "quoted" option (#854) ("https://twitter.com/StobiesGalaxy/status/1270755918330896395", { + "options": (("quoted", True),), "pattern": r"https://pbs\.twimg\.com/media/Ea[KG].+=jpg", "count": 8, }), - # "quoted" option (#854) + # quoted tweet (#526, #854) ("https://twitter.com/StobiesGalaxy/status/1270755918330896395", { - "options": (("quoted", False),), "pattern": r"https://pbs\.twimg\.com/media/EaK.+=jpg", "count": 4, }), @@ -499,6 +497,7 @@ class TwitterTweetExtractor(TwitterExtractor): }), # retweet with missing media entities (#1555) ("https://twitter.com/morino_ya/status/1392763691599237121", { + "options": (("retweets", True),), "count": 4, }), )