Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #660 from Eboreg/dev-Eboreg
Browse files Browse the repository at this point in the history
Always add tweet_mode to API requests
  • Loading branch information
bear authored Dec 19, 2021
2 parents 13276b6 + 29647e6 commit 1a148ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ violations.flake8.txt

# Built docs
doc/_build/**

# Mypy cache
**/.mypy_cache

# VS Code
**/.vscode
3 changes: 2 additions & 1 deletion twitter/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5160,6 +5160,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:
Expand All @@ -5175,7 +5177,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, verify=self.verify_ssl, cert=self.cert_ssl)

Expand Down

0 comments on commit 1a148ea

Please sign in to comment.