From 1ae48a54f87afe578f6907830d3a2e5d5ada758a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 2 Feb 2023 22:01:36 +0100 Subject: [PATCH] [twitter] add 'transform' option --- docs/configuration.rst | 10 ++++++++++ gallery_dl/extractor/twitter.py | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index 27efbf54..6ac0eebe 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2839,6 +2839,16 @@ Description `syndication `__ API. +extractor.twitter.transform +--------------------------- +Type + ``bool`` +Default + ``true`` +Description + Transform Tweet and User metadata into a simpler, uniform format. + + extractor.twitter.size ---------------------- Type diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 17a2202b..137a9b59 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -41,6 +41,10 @@ class TwitterExtractor(Extractor): self.cards = self.config("cards", False) self.cards_blacklist = self.config("cards-blacklist") self.syndication = self.config("syndication") + + if not self.config("transform", True): + self._transform_user = util.identity + self._transform_tweet = util.identity self._user = self._user_obj = None self._user_cache = {} self._init_sizes()