mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-12 20:38:29 +03:00
Fix KeyError caused by retweets without URLs in TwitterProfileScraper
This commit is contained in:
@@ -605,6 +605,9 @@ class _TwitterAPIScraper(snscrape.base.Scraper):
|
|||||||
i = kwargs['tcooutlinks'].index(card.url)
|
i = kwargs['tcooutlinks'].index(card.url)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
_logger.warning('Could not find card URL in tcooutlinks')
|
_logger.warning('Could not find card URL in tcooutlinks')
|
||||||
|
except KeyError:
|
||||||
|
# retweets are missing this attribute
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
card.url = kwargs['outlinks'][i]
|
card.url = kwargs['outlinks'][i]
|
||||||
return Tweet(**kwargs)
|
return Tweet(**kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user