From b34844e2596832144fd4750589f9e842a46e7da8 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 23 Aug 2025 16:13:31 +0100 Subject: [PATCH] Avoid calling extractStatusV2Anon twice --- twitfix.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/twitfix.py b/twitfix.py index 020c3e9..5fb764c 100644 --- a/twitfix.py +++ b/twitfix.py @@ -266,19 +266,13 @@ def getTweetData(twitter_url,include_txt="false",include_rtf="false"): return cachedVNF try: - rawTweetData = twExtract.extractStatusV2Anon(twitter_url, None) + if config['config']['workaroundTokens'] is not None: + workaroundTokens = config['config']['workaroundTokens'].split(",") + else: + workaroundTokens = None + rawTweetData = twExtract.extractStatus(twitter_url,workaroundTokens=workaroundTokens) except: rawTweetData = None - if rawTweetData is None: - try: - if config['config']['workaroundTokens'] is not None: - workaroundTokens = config['config']['workaroundTokens'].split(",") - else: - workaroundTokens = None - - rawTweetData = twExtract.extractStatus(twitter_url,workaroundTokens=workaroundTokens) - except: - rawTweetData = None if rawTweetData == None or 'error' in rawTweetData: return None