Intagram embed

Comments

9 comments

  • MrKafr

    Please use Submit a Request or join tester server.

    -4
  • Purpleboye_

    Same problem. It's a little harder for me to share my art now.

    2
  • mb9023

    >Please use Submit a Request or join tester server

    The Tester server only deals with the mobile app for some reason now.

     

    Instagram embeds have been broken for way too long on all platforms.

    2
  • patach

    Yeah, this is annoying.  Has Instagram been a problem on other platforms?  Seems there was an update on it that led to alot of trouble.  

    2
  • Twipped

    We share a lot of IG content on my server and this has been quite vexing.

    2
  • Zipdox

    I know the exactly why it's not working. I investigated it myself. The problem lies with Instagram itself. Discord fetches the pages and extracts meta tags from the HTML in order to determine what to embed. The problem is that Instagram started giving blank responses to HTTP requests with user agents that aren't from real web browsers. They probably did this to prevent botting and scraping.

    The solution is to add an exception to Discord's embedding scrapers to supply a custom user agent when fetching pages from Instagram. I don't know if Instagram would like that though.

    Anyway, I wrote a bot to embed Instagram links posted in text channels: https://gitlab.com/zipdox/instagram-embed-bot. One problem is the bot requires libcurl so I don't know if it can run on Windows or Mac. This is because Instagram also has some other funky systems that prevent my bot from receiving meta tags when using a different library for HTTP requests.

    4
  • Purpleboye_

    That's awesome Zipdox, how do we use it exactly?

    1
  • Zipdox

    I assume you have NodeJS and NPM installed. Just clone the repo and run npm install. Then create a file named token.json and put the bot token in it in double quotes. You run the bot by running node index.js.

    2
  • D4ddy-LiLd4rk

    Well... the fun part is that today when I shared an insta link SUDDENLY the embed worked again... but only sometimes? I am still confused xD

    1

Please sign in to leave a comment.