Downloading user's GIF posted from favorite GIF Issue

I am currently making a system that automatically download images from links found within user's content. For moderation purpose only! It would seem like some favorite link that are posted don't contain the famous expiration link at the end, but discord loads them anyway with the image preview as if they were perfectly fine. trying to do a fetch on that URL tho doesn't work, same as accessing the URL manually on the browser.. doesn't work. Here's how to replicate: 1. Post a gif picture (with a file) anywhere 2. Add that gif as a favorite 3. Use that Gif from your favorite. That gif will have a normal link without expiration and will always work on Discord, but not on the browser or in node fetch. I was wondering if maybe there is something I'm missing or doing wrong.. how am I supposed to download the gif in such situation? I'm using Typescript ofc. Thank you!
Solution:
Alright, I found a solution, altho I'm still unsure of something, I understood at least that we can just wait and refetch a message to get any image URL from the embed's image. I just didn't fully understood they were actual embeds. What I just don't know is how to see the distinction between an URL that creates an embed for say, a website vs an URL that gets replaced with an image embed :shrug: weird. I guess one could check if the embed has a title or other stuff like that to know if it's only an image '^^...
Jump to solution
1 Reply
Solution
lolmaxz
lolmaxz2mo ago
Alright, I found a solution, altho I'm still unsure of something, I understood at least that we can just wait and refetch a message to get any image URL from the embed's image. I just didn't fully understood they were actual embeds. What I just don't know is how to see the distinction between an URL that creates an embed for say, a website vs an URL that gets replaced with an image embed :shrug: weird. I guess one could check if the embed has a title or other stuff like that to know if it's only an image '^^

Did you find this page helpful?