Merge branch 'main' of github.com:dylanpdx/BetterTwitFix

This commit is contained in:
Dylan 2025-03-26 23:17:38 +00:00
commit d60b58d39c
2 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,8 @@ Just replace twitter.com with vxtwitter.com on the link to the tweet! `https://t
You can also replace x.com links with fixvx.com
Accessing `https://vxtwitter.com/preferences` will allow you to change how you are redirected to tweets when opening them in your browser - Either by opening them on the mobile app, or opening the tweet in a [Nitter](https://github.com/zedeus/nitter) instance.
## API
If you're a nerd like me and want to use information about a tweet in your code, you can make a request to `api.vxtwitter.com` to get basic information about a tweet:
`https://api.vxtwitter.com/Twitter/status/1577730467436138524`

View File

@ -172,12 +172,17 @@ def getTweetData(twitter_url,include_txt="false",include_rtf="false"):
return cachedVNF
try:
rawTweetData = twExtract.extractStatusV2Anon(twitter_url)
rawTweetData = twExtract.extractStatusV2Anon(twitter_url, None)
except:
rawTweetData = None
if rawTweetData is None:
try:
rawTweetData = twExtract.extractStatus(twitter_url,workaroundTokens=config['config']['workaroundTokens'].split(','))
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: