From 09ed116ca5b4077911f5a6a2f993dfb71c7196c8 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 12 Jul 2023 22:02:51 +0100 Subject: [PATCH] API fix for TweetWithVisibilityResults --- twitfix.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/twitfix.py b/twitfix.py index d4de2de..c189de1 100644 --- a/twitfix.py +++ b/twitfix.py @@ -104,10 +104,12 @@ def twitfix(sub_path): image = ( int(request.url[-1]) - 1 ) return embed_video(clean, image) - elif request.url.startswith("https://api.vx"): + elif True: twitter_url = "https://twitter.com/" + sub_path try: tweet = twExtract.extractStatusV2(twitter_url) + if '__typename' in tweet and tweet['__typename'] == 'TweetWithVisibilityResults': + tweet=tweet['tweet'] tweetL = tweet["legacy"] userL = tweet["core"]["user_results"]["result"]["legacy"] media=[]