From 6f839d0261361beb02af6df92a2f4df5d0fec946 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 29 Sep 2023 16:32:19 +0100 Subject: [PATCH] Added possibly_sensitive to API (#147) and qrtURL --- twitfix.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/twitfix.py b/twitfix.py index c25029a..319c9f6 100644 --- a/twitfix.py +++ b/twitfix.py @@ -215,6 +215,10 @@ def twitfix(sub_path): media.append(zipurl) media_extended.append({"url":zipurl,"type":"zip"}) + qrtURL = None + if 'quoted_status_id_str' in tweetL: + qrtURL = "https://twitter.com/i/status/" + tweetL['quoted_status_id_str'] + apiObject = { "text": tweetL["full_text"], "likes": tweetL["favorite_count"], @@ -228,7 +232,9 @@ def twitfix(sub_path): "conversationID": tweetL["conversation_id_str"], "mediaURLs": media, "media_extended": media_extended, - "hashtags": hashtags + "possibly_sensitive": tweetL["possibly_sensitive"], + "hashtags": hashtags, + "qrtURL": qrtURL, } try: apiObject["date_epoch"] = int(datetime.strptime(tweetL["created_at"], "%a %b %d %H:%M:%S %z %Y").timestamp())