Fix bug in handling retweets without media

This commit is contained in:
Logan Williams
2022-03-31 15:51:17 +02:00
parent a5cffa615f
commit c8d1b96e3f

View File

@@ -37,10 +37,12 @@ class TwitterScraper(Scraper):
if tweet.media:
media_list += tweet.media
if tweet.retweetedTweet and tweet.retweetedTweet.media:
print(tweet.json())
if tweet.retweetedTweet and hasattr(tweet.retweetedTweet, 'media') and tweet.retweetedTweet.media:
media_list += tweet.retweetedTweet.media
if tweet.quotedTweet and tweet.quotedTweet.media:
if tweet.quotedTweet and hasattr(tweet.quotedTweet, 'media') and tweet.quotedTweet.media:
media_list += tweet.quotedTweet.media
for media in media_list: