FixTweet / FxTwitter

Fix broken Twitter/X embeds! Use multiple images, videos, polls, translations and more on Discord, Telegram and others
https://fxtwitter.com
MIT License
2.61k stars 77 forks source link

Some Tweets from NSFW accounts will not embed due to Twitter API changes #224

Closed dangeredwolf closed 1 year ago

dangeredwolf commented 1 year ago

Twitter's API can no longer query Tweets from NSFW accounts containing media. This affects not only FixTweet but other software relying on guest token access to the API, including vxTwitter, youtube-dl/yt-dlp, and others.

A workaround / solution to this issue is still pending. If you like breaking Twitter's API and come up with a workable solution to this issue I'd love to hear about it ASAP.

Note that while the timing of this is similar to Twitter shutting down API access for developers, this is not directly caused by that, and FixTweet can still currently embed the vast majority of Tweets on the platform. They did, however, modify their API causing this error.

For the more technically inclined, we use Twitter API v2 /2/timeline/conversation/{id}.json along with a guest token to perform Tweet fetches. Affected Tweets are instead labeled with "This Tweet is unavailable." tombstones while other Tweets load. There is also /1.1/statuses/show.json?id={id}, which for affected Tweets returns a 404 Not Found with JSON-embedded message Sorry, that page does not exist..

RuiNtD commented 1 year ago

PLEASE change the embed error message, so it's clear that it's a failed embed. I saw the embed error message in a NSFW chat and reposted it in an SFW chat, thinking it was an actual tweet with that text. It embedded perfectly fine in the SFW chat, and now I'm considering deleting my entire Discord account out of embarrassment. :D

EDIT: My suggestion is to change the embed to something like: Failed to Embed NSFW Tweet Due to Twitter API changes, we failed to embed this NSFW Tweet. We are currently looking into a workaround.

dangeredwolf commented 1 year ago

@RuiNtD I did actually put in a message for the failed embeds. If that wasn't working it may have been related to issues with Discord not embedding things (which does happen sometimes). We have a workaround in place now, so hopefully you won't see it anymore.

RuiNtD commented 1 year ago

Yeah, I saw this embed on Telegram: But IMO it wasn't clear enough that the message was from the tweet failing to embed. I thought it was the linked tweet actually saying that.

dangeredwolf commented 1 year ago

Well, it was a temporary outage, so hopefully you won't see it again haha