diff --git a/docs/configuration.rst b/docs/configuration.rst index 3af398b6..761a9540 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2343,6 +2343,16 @@ Description * ``"ytdl"``: Additionally download video content from unsupported cards using `youtube-dl`_ +extractor.twitter.cards-blacklist +--------------------------------- +Type + ``list`` of ``strings`` +Example + ``["player", "summary"]`` +Description + List of card types to ignore + + extractor.twitter.conversations ------------------------------- Type diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index d288e685..d7ed764d 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -41,6 +41,7 @@ class TwitterExtractor(Extractor): self.quoted = self.config("quoted", False) self.videos = self.config("videos", True) self.cards = self.config("cards", False) + self.cards_blacklist = self.config("cards-blacklist") or () self._user = self._user_obj = None self._user_cache = {} self._init_sizes() @@ -174,7 +175,10 @@ class TwitterExtractor(Extractor): card = tweet["card"] if "legacy" in card: card = card["legacy"] - name = card["name"] + + name = card["name"].rpartition(":")[2] + if name in self.cards_blacklist: + return if name in ("summary", "summary_large_image"): bvals = card["binding_values"]