You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Without considering how fxtwitter works internally (I haven't read the code yet), I have 2 suggestions to resolve this issue:
Return 404 when requesting an invalid media index: With the example above, /photo/4 and beyond should return a 404. This way I can iterate through the indexes from 1 and continue until a 404.
Create a GET API that returns information about a post given the post ID: Maybe something like this:
{
"id": 12345,
"content": "something this post says about",
"medias": [
"https://pbs.twimg.com/media/GFUk9BRXoAA2zi0",
"..."
]
}
The text was updated successfully, but these errors were encountered:
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
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.The text was updated successfully, but these errors were encountered: