Discord embed not working – metadata differs from production deployment
Hello,
First of all, thank you for your work on this project.
I'm opening this issue because the HTTP response generated by my self-hosted deployment of Instafix seems to differ from the production instance on ddinstagram.com. I'm thinking this difference in the meta tags might be responsible for the embed video to not load?
I've tested both the main and dev branches, but the response I'm getting appears to be missing certain meta tags or includes values that may prevent Discord from rendering the embedded video properly.
Example from my self-hosted deployment (dev branch, which does not embed in Discord):
<meta charset="utf-8" />
<meta name="theme-color" content="#CE0071" />
<meta name="twitter:card" content="player" />
<meta name="twitter:title" content="[redacted]" />
<meta name="twitter:player:width" content="0" />
<meta name="twitter:player:height" content="0" />
<meta name="twitter:player:stream" content="/videos/[redacted]/1" />
<meta name="twitter:player:stream:content_type" content="video/mp4" />
<meta property="og:site_name" content="InstaFix" />
<meta property="og:url" content="https://instagram.com/reel/[redacted]/" />
<meta property="og:description" content="[redacted]" />
<meta property="og:video" content="/videos/[redacted]/1" />
<meta property="og:video:secure_url" content="/videos/[redacted]/1" />
<meta property="og:video:type" content="video/mp4" />
<meta property="og:video:width" content="0" />
<meta property="og:video:height" content="0" />
<link rel="alternate" href="http://[redacted]/oembed?text=[redacted]&url=https://instagram.com/reel/[redacted]/" type="application/json+oembed" title="[redacted]" />
<meta http-equiv="refresh" content="0; url = https://instagram.com/reel/[redacted]/" />
Example from ddinstagram.com (working embed in Discord):
<link rel="canonical" href="https://www.instagram.com/reel/[redacted]/"/>
<meta property="og:url" content="https://www.instagram.com/reel/[redacted]/"/>
<meta property="twitter:site" content="[redacted]" />
<meta property="twitter:creator" content="[redacted]" />
<meta property="theme-color" content="#0084ff" />
<meta property="twitter:title" content="[redacted]" />
<meta http-equiv="refresh" content="0;url=https://www.instagram.com/reel/[redacted]/"/>
<meta property="og:title" content="[redacted]" />
<meta property="og:description" content="[redacted]"/>
<meta property="og:site_name" content="InstaFix" />
<meta property="twitter:card" content="summary_large_image"/>
<meta property="og:video" content="/videos/[redacted]/1"/>
<meta property="og:video:secure_url" content="/videos/[redacted]/1"/>
<meta property="og:video:type" content="video/mp4"/>
<meta property="og:video:width" content="1080"/>
<meta property="og:video:height" content="1920"/>
<meta property="twitter:card" content="player"/>
<meta property="twitter:player:stream" content="/videos/[redacted]/1"/>
<meta property="twitter:player:stream:content_type" content="video/mp4"/>
<meta property="twitter:player:width" content="1080"/>
<meta property="twitter:player:height" content="1920"/>
<link rel="alternate" href="https://ddinstagram.com/oembed/?author_name=[redacted]&author_url=https%3A%2F%2Fwww.instagram.com%2Freel%2F[redacted]%2F" type="application/json+oembed">
<link href="https://ddinstagram.com/users/[redacted]/statuses/[redacted]" rel="alternate" type="application/activity+json">
My self-hosted version sets both width and height to 0, which may be causing Discord to reject the embed. Seems the scrapper struggles getting these values Some meta tags (like og:title, twitter:site, canonical, etc.) are present in the working version but missing from mine.
Could the embed failure be due to missing or incomplete meta tags, such as width/height or og:title? Is there a known reason the open-source version would behave differently than the deployed version on ddinstagram.com?
Currently, only these below works:
- g.ddinstagram.com
- d.ddinstagram.com
The origin www.ddinstagram.com just not embed. I guess We could just swtich to g.ddinstagram.com as a workaround now.
I've just tested with www.ddinstagram.com and it seems to work fine in discord. The issue is, the open source version from this github is not up to date with the deployed version, for some reason..
I've just tested with www.ddinstagram.com and it seems to work fine in discord. The issue is, the open source version from this github is not up to date with the deployed version, for some reason..
Mine still doesn't work
e.g. https://www.ddinstagram.com/p/DMQcQnmyzqc
Indeed, the link you've provided doesn't embed, but it seems to work correctly if you replace the /p/ from your URL by /reel/
I've tried to query both these URLs with curl to see what happens, seems the one with /p/ returns a "500 Internal Server Error" while the one with /reel/ returns correct embed data
What's even weirder is, if I take a random reel like this one https://www.instagram.com/reel/DKVTdMEKcwf/ and try to embed it with /p/ instead of /reel/, it works just fine. So my guess is, maybe all the chinese characters from your reel might somehow break the embedding with /p/, but idk why it would work better with /reel/
Replacing /p/ to /reel/ doesn't work either here, but when you switch the URL to https://g.ddinstagram.com/p/DMQcQnmyzqc , it works.
Both URLs with /p/ and /reel/ could do the redirect to the correct page in Instagram. It might just a random server issue for Meta when you saw the 500 error.
I think the behavior of ddinstagram is quite unstable actually haha
Last time I used curl to check the embed data from the server - the d.ddinstagram worked well with /reel/ but threw an error with /p/, I think it was rather a bug from the Instafix's scrapper than from instagram itself.
You can try on your side with that command (and tweak the URL) and you'll see what it returns :
curl -H "User-Agent: Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)" https://d.ddinstagram.com/p/DMQcQnmyzqc
Currently, if I try the above request (with d.dd...) it returns an empty response. With g.dd I'm getting a well formed response, hence why it works in Discord
Replacing /p/ to /reel/ doesn't work either here, but when you switch the URL to https://g.ddinstagram.com/p/DMQcQnmyzqc , it works.
Thank you for the report, this really helps! Should be fixed now.
@Wikidepia Confirmed. The link is working like a charm now. Thank you so much!
@Knoppiix You could check the metadata how it goes.