From 29647e6cb2a050e9e9c4a02c865d0231e2e497fc Mon Sep 17 00:00:00 2001 From: Robert Huselius Date: Wed, 29 Apr 2020 23:44:03 +0200 Subject: [PATCH] Always add tweet_mode to API requests --- .gitignore | 6 ++++++ twitter/api.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7ef3b53c..f5955911 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,9 @@ violations.flake8.txt # Built docs doc/_build/** + +# Mypy cache +**/.mypy_cache + +# VS Code +**/.vscode diff --git a/twitter/api.py b/twitter/api.py index 13d88799..986b35f5 100755 --- a/twitter/api.py +++ b/twitter/api.py @@ -5107,6 +5107,8 @@ def _RequestUrl(self, url, verb, data=None, json=None, enforce_auth=True): if not data: data = {} + data['tweet_mode'] = self.tweet_mode + if verb == 'POST': if data: if 'media_ids' in data: @@ -5122,7 +5124,6 @@ def _RequestUrl(self, url, verb, data=None, json=None, enforce_auth=True): resp = 0 # POST request, but without data or json elif verb == 'GET': - data['tweet_mode'] = self.tweet_mode url = self._BuildUrl(url, extra_params=data) resp = self._session.get(url, auth=self.__auth, timeout=self._timeout, proxies=self.proxies)