[twitter] handle Tweets with "softIntervention" entries

or other such things where the actual Tweet data is one level deeper
than usual
This commit is contained in:
Mike Fährmann
2022-03-03 01:56:14 +01:00
parent 64bbc7969d
commit 2aa47e8382

View File

@@ -649,6 +649,10 @@ class TwitterTweetExtractor(TwitterExtractor):
("https://twitter.com/i/web/status/1460044411165888515", { ("https://twitter.com/i/web/status/1460044411165888515", {
"count": 0, "count": 0,
}), }),
# "Misleading" content
("https://twitter.com/i/web/status/1486373748911575046", {
"count": 4,
}),
) )
def __init__(self, match): def __init__(self, match):
@@ -1166,6 +1170,8 @@ class TwitterAPI():
if "tombstone" in tweet: if "tombstone" in tweet:
self._report_tombstone(entry, tweet["tombstone"]) self._report_tombstone(entry, tweet["tombstone"])
continue continue
if "tweet" in tweet:
tweet = tweet["tweet"]
legacy = tweet["legacy"] legacy = tweet["legacy"]
except KeyError: except KeyError:
extr.log.debug( extr.log.debug(