diff --git a/docs/configuration.rst b/docs/configuration.rst index a1064ae0..bcf94efe 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2030,11 +2030,15 @@ Description extractor.twitter.cards ----------------------- Type - ``bool`` + ``bool`` or ``string`` Default - ``false`` + ``true`` Description - Fetch media from `Cards `__. + Controls how to handle `Twitter Cards `__. + + * ``false``: Ignore cards + * ``true``: Download image content from supported cards + * ``"ytdl"``: Additionally download video content from unsupported cards using `youtube-dl`_ extractor.twitter.conversations diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 8e7ff6db..30be8402 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -265,7 +265,7 @@ { "username": null, "password": null, - "cards": false, + "cards": true, "conversations": false, "pinned": false, "quoted": false, diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 02df711a..00d443e2 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -39,7 +39,7 @@ class TwitterExtractor(Extractor): self.pinned = self.config("pinned", False) self.quoted = self.config("quoted", False) self.videos = self.config("videos", True) - self.cards = self.config("cards", False) + self.cards = self.config("cards", True) self._user_cache = {} self._init_sizes() @@ -165,7 +165,7 @@ class TwitterExtractor(Extractor): tweet, data["media_entities"].values(), files) return - if self.videos: + if self.cards == "ytdl": url = "ytdl:{}/i/web/status/{}".format(self.root, tweet["id_str"]) files.append({"url": url})