Fix KeyError caused by retweets without URLs in TwitterProfileScraper

This commit is contained in:
Logan Williams
2022-02-24 18:08:12 +01:00
parent 72b26f2373
commit de4ebed81f

View File

@@ -605,6 +605,9 @@ class _TwitterAPIScraper(snscrape.base.Scraper):
i = kwargs['tcooutlinks'].index(card.url)
except ValueError:
_logger.warning('Could not find card URL in tcooutlinks')
except KeyError:
# retweets are missing this attribute
pass
else:
card.url = kwargs['outlinks'][i]
return Tweet(**kwargs)