API fix for TweetWithVisibilityResults

This commit is contained in:
Dylan 2023-07-12 22:02:51 +01:00
parent 645e7cc329
commit 09ed116ca5

View File

@ -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=[]