Open seriaati opened 8 months ago
About the 2nd point, we actually have an API for FxTwitter (see api.fxtwitter.com). Not sure if that's helpful in your case. It would probably be a good idea to improve direct media's behavior here cause right now it's handled the same as embeds but it would be probably more useful to actually only return the media if it was found
Nice, the API works for me. It's up to you if you want to fix the direct media links.
The problem
The readme says adding
/photo/{index}
after the post ID allows getting the other medias in the post.For example, this post https://twitter.com/qiandaiyiyu/status/1753349204380938507 has 3 images, and the following can get all 3 of them:
However, if I request to https://d.fxtwitter.com/qiandaiyiyu/status/1753349204380938507/photo/4, fxtwitter will return the first image for some reason, then https://d.fxtwitter.com/qiandaiyiyu/status/1753349204380938507/photo/5 leads to https://github.com/FixTweet/FxTwitter.
My project uses fxtwitter to extract media (URL)s directly from the post and send them in a Discord channel, but with the current behavior, I can only send the first image URL because I don't have a consistent way of knowing how many medias this post has.
My suggestion
Without considering how fxtwitter works internally (I haven't read the code yet), I have 2 suggestions to resolve this issue:
/photo/4
and beyond should return a 404. This way I can iterate through the indexes from 1 and continue until a 404.