Why instagram link onebox like this?

why does this instagram link onebox like this?

https://www.instagram.com/p/B3jG277hve9/

it also links to nowhere if I don’t use hyperlinked text (you can click on the one-boxed link above)!

the link:
https://www.instagram.com/p/B3jG277hve9/

3개의 좋아요

My guess is it is a private account?

2개의 좋아요

Nope, that’s not a private account. Here’s another example from a fully public post:

https://www.instagram.com/p/B6gUJwDl-lQ/


Wow, I posted https://www.instagram.com/p/B6gUJwDl-lQ/ but the onebox redirects to this topic itself…

(edit my post to repro this in the composer)

3개의 좋아요

What’s different about this photo versus others?

2개의 좋아요

It seems that some Instagram pages have a canonical link with a different url that requires login. The code in the onebox library prefers the canonical url.

For example, these are the canonical urls of the instagrams in this topic:

https://www.instagram.com/shaparakgroup.ir/p/B3jG277hve9/caption/backhand_index_pointing_right-chp-shprkh-ok_hand-black_small_square-khrt-wyzyt-hy-brsh-khs

https://www.instagram.com/dogsofinstagram/p/B6gUJwDl-lQ/caption/happy-holidays-writes-konaandcamper-misslolathegoldendoodle-camera_with_flash-by-sh

6개의 좋아요

I’m getting this issue as well. Upgrading my installation now to see if it fixes.

@techAPJ can you fix this please? Basically we have to ignore canonical metadata for Instagram now..

6개의 좋아요

Done via:

https://github.com/discourse/onebox/commit/0d88354b4b85c572a7f2431bd01d849392625b5c

Example link:

https://www.instagram.com/p/B7Cz042qSxv/

10개의 좋아요

Looks like we’ve regressed here, or Instagram changed something again. We’re back to just showing “Login • Instagram”. cc @techAPJ

13개의 좋아요

Weird, that image on Instagram doesn’t have any og: meta tags anymore. :grimacing: Couldn’t find any other that would have them missing…

5개의 좋아요

The weird thing is Instagram onebox is working okay for me locally (on latest Discourse version). And I do see OpenGraph (og) tags in incognito mode.

Reproducing this issue locally will be tricky.. investigating more.

7개의 좋아요

Is it specific to that one image? :thinking:

3개의 좋아요

No, I tried multiple images from multiple accounts and all were oneboxing fine locally.

Here’s an image from an hour ago on NatGeo oneboxing fine locally.

Might be geographical issue?

FWIW, Instagram oneboxing is failing on discourse.codinghorror.com as well, so this issue is not specific to meta.

5개의 좋아요

Maybe the user agent changes the response?

9개의 좋아요

https://www.instagram.com/p/CAojxzfjO0y/

this is broken on our forum as well

1개의 좋아요

I don’t think so. We use same user agent for all the requests made from Discourse codebase as per:

2개의 좋아요

Same issue on ours now here in the UK too.

I am updating Instagram onebox to use official oEmbed endpoints. I have this change working locally and expect to push a fix later today. Hopefully the Instagram oEmbed endpoints will not have geographical restrictions.

6개의 좋아요