[twitter] fix regression from 160335ad

Tweets from 'homeConversation' or 'conversationthread' entries do not
contain a 'sortIndex' field. Accessing it raises a KeyError and would
erroneously get them labeled as 'deleted'.
This commit is contained in:
Mike Fährmann
2023-04-06 19:22:48 +02:00
parent 160335ad44
commit 1c1f6fdc80

View File

@@ -1585,7 +1585,7 @@ class TwitterAPI():
if "tweet" in tweet:
tweet = tweet["tweet"]
legacy = tweet["legacy"]
tweet["sortIndex"] = entry["sortIndex"]
tweet["sortIndex"] = entry.get("sortIndex")
except KeyError:
extr.log.debug(
"Skipping %s (deleted)",
@@ -1633,7 +1633,8 @@ class TwitterAPI():
tweet["core"]["user_results"]["result"]
["legacy"]["screen_name"])
quoted["legacy"]["quoted_by_id_str"] = tweet["rest_id"]
quoted["sortIndex"] = entry["sortIndex"]
quoted["sortIndex"] = entry.get("sortIndex")
yield quoted
except KeyError:
extr.log.debug(