Return to using extractStatusV2Anon

This commit is contained in:
Dylan
2025-09-24 21:44:41 +01:00
parent 433f015c07
commit b657ae0076
2 changed files with 12 additions and 3 deletions

View File

@@ -495,7 +495,7 @@ def fixTweetData(tweet):
def extractStatus(url,workaroundTokens=None):
# TODO: commented out methods are too slow/unreliable at the moment
methods=[extractStatus_syndication,extractStatusV2]#,extractStatusV2Android,extractStatusV2TweetDetail] #
methods=[extractStatusV2Anon,extractStatusV2]#,extractStatusV2Android,extractStatusV2TweetDetail] #
for method in methods:
try:
result = method(url,workaroundTokens)

View File

@@ -23,9 +23,10 @@ def getApiUserResponse(user):
def getApiResponse(tweet,include_txt=False,include_rtf=False):
tweetL = tweet["legacy"]
if "user_result" in tweet["core"]:
userL = tweet["core"]["user_result"]["result"]["legacy"]
user = tweet["core"]["user_result"]["result"]
elif "user_results" in tweet["core"]:
userL = tweet["core"]["user_results"]["result"]["legacy"]
user = tweet["core"]["user_results"]["result"]
userL = user["legacy"]
media=[]
media_extended=[]
hashtags=[]
@@ -33,6 +34,14 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False):
oldTweetVersion = False
tweetArticle=None
lang=None
if "screen_name" not in userL:
userL["screen_name"] = user["core"]["screen_name"]
if "name" not in userL:
userL["name"] = user["core"]["name"]
if "profile_image_url_https" not in userL:
userL["profile_image_url_https"] = user["avatar"]["image_url"]
#editedTweet=False
try:
if "birdwatch_pivot" in tweet: