diff --git a/docs/configuration.rst b/docs/configuration.rst index 6322e790..23695eb0 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2200,6 +2200,17 @@ Description * ``false``: Skip video Tweets +extractor.twitter.warnings +-------------------------- +Type + ``bool`` +Default + ``false`` +Description + Emit `logging messages `_ + for non-fatal errors reported by Twitter's API. + + extractor.unsplash.format ------------------------- Type diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 400a3eae..2fa556e4 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -759,6 +759,8 @@ class TwitterAPI(): "__fs_interactive_text": False, "__fs_dont_mention_me_view_api_enabled": False, } + + self._log_warnings = extractor.config("warnings") self._json_dumps = json.JSONEncoder(separators=(",", ":")).encode self._user = None @@ -940,7 +942,7 @@ class TwitterAPI(): endpoint = "/1.1/guest/activate.json" return str(self._call(endpoint, None, root, "POST")["guest_token"]) - def _call(self, endpoint, params, root=None, method="GET", warning=True): + def _call(self, endpoint, params, root=None, method="GET"): if root is None: root = self.root @@ -965,7 +967,7 @@ class TwitterAPI(): if response.status_code < 400: # success - if errors and warning: + if errors and self._log_warnings: self.extractor.log.warning(errors) return data