diff --git a/docs/configuration.rst b/docs/configuration.rst index f7a1bbcc..8a0b991b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -3002,15 +3002,19 @@ Description extractor.twitter.conversations ------------------------------- Type - ``bool`` + * ``bool`` + * ``string`` Default ``false`` Description For input URLs pointing to a single Tweet, e.g. `https://twitter.com/i/web/status/`, fetch media from all Tweets and replies in this `conversation - `__ - or thread. + `__. + + If this option is equal to ``"accessible"``, + only download from conversation Tweets + if the given initial Tweet is accessible. extractor.twitter.csrf diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 710bde33..10db9744 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -919,7 +919,9 @@ Your reaction.""", self.tweet_id = match.group(2) def tweets(self): - if self.config("conversations", False): + conversations = self.config("conversations") + if conversations: + self._accessible = (conversations == "accessible") return self._tweets_conversation(self.tweet_id) else: return self._tweets_single(self.tweet_id) @@ -950,6 +952,11 @@ Your reaction.""", tweet.get("_retweet_id_str") == tweet_id: self._assign_user(tweet["core"]["user_results"]["result"]) break + else: + # initial Tweet not accessible + if self._accessible: + return () + return buffer return itertools.chain(buffer, tweets)