Require extended tweets for quoted tweets. Fixes #352

This commit is contained in:
2021-01-22 09:15:47 -06:00
parent 64b6d4df74
commit 747290e16a
3 changed files with 4 additions and 3 deletions

View File

@@ -145,7 +145,7 @@ class baseBufferController(baseBuffers.buffer):
while l != False:
tweetsList.append(tweet)
try:
tweet = self.session.twitter.get_status(id=l, include_ext_alt_text=True)
tweet = self.session.twitter.get_status(id=l, include_ext_alt_text=True, tweet_mode="extended")
tweet.full_text = utils.expand_urls(tweet.full_text, tweet.entities)
except TweepError as e:
utils.twitter_error(e)

View File

@@ -225,7 +225,7 @@ class viewTweet(basicTweet):
else:
text = text + " @%s: %s\n" % (tweetList[i].user.screen_name, getattr(tweetList[i], value))
# tweets with extended_entities could include image descriptions.
if getattr(tweetList[i], "extended_entities") and "media" in tweetList[i].extended_entities:
if hasattr(tweetList[i], "extended_entities") and "media" in tweetList[i].extended_entities:
for z in tweetList[i].extended_entities["media"]:
if "ext_alt_text" in z and z["ext_alt_text"] != None:
image_description.append(z["ext_alt_text"])