# Imgur embeds broken

**URL:** https://meta.discourse.org/t/imgur-embeds-broken/29869
**Category:** Bug
**Created:** [June 10, 2015, 9:24pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869 "2015-06-10T21:24:14Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![laskater](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@laskater](https://meta.discourse.org/u/laskater)
#### Post date: [June 10, 2015, 9:24pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/1 "2015-06-10T21:24:14Z")

</div>

Imgur galleries used to show up with a nice onebox preview of the gallery, but this broke recently and just a link is shown. e.g.

[[Album] 10 More awesome Photoshop tutorials. ![](https://global.discourse-cdn.com/meta/original/3X/c/2/c276305d1220f41bc7eabd89e4a5cf09410fedf4.jpeg "10 More awesome Photoshop tutorials.") ](https://imgur.com/a/PWgY0)

I viewed [this topic on Meta](https://meta.discourse.org/t/til-discourse-can-embed-imgur-albums-and-galleries/27406) on May 26th and the preview was working, now it is not. The preview in the first post will show up if you try replying to that topic (or this topic), and pasting any imgur galley URL into the edit box, but you won’t see a preview for the URL you just pasted. The preview won’t be there if you refresh the page.

I saw the same behavior on a forum hosted at [Communiteq](https://www.communiteq.com) (formerly DiscourseHosting) also on May 26th, when they were running 1.2. The behavior is still there this week with 1.3.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 10, 2015, 9:28pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/2 "2015-06-10T21:28:20Z")

</div>

It’s because Imgur changed it on their end.

---

<div class="post-metadata">

### Author: ![laskater](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@laskater](https://meta.discourse.org/u/laskater)
#### Post date: [June 10, 2015, 9:49pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/3 "2015-06-10T21:49:36Z")

</div>

Hmm, that doesn’t explain why it was working here but not at my [Communiteq](https://www.communiteq.com) (formerly DiscourseHosting) forum at the same time (on May 26th). Is this broken until Imgur changes something back, or until Discourse releases a fix?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 10, 2015, 9:58pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/4 "2015-06-10T21:58:46Z")

</div>

See @eviltrout’s answer here:

> **[imgur](https://help.imgur.com/hc/en-us)**

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [June 10, 2015, 11:57pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/5 "2015-06-10T23:57:14Z")

</div>

Here’s a little freaky magic for ya - you can get them working by attempting to reply with any imgur gallery URL.

![](https://global.discourse-cdn.com/meta/original/3X/6/e/6e535adc4c7e18206b9f8cd88e7a10190e149281.gif)

obviously not a fix, nor real magic - sorry

---

<div class="post-metadata">

### Author: ![anonymous234](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@anonymous234](https://meta.discourse.org/u/anonymous234)
#### Post date: [August 3, 2015, 6:22pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/6 "2015-08-03T18:22:48Z")

</div>

I was about to submit this bug again but I found this.

However, as the last post shows, **sometimes embeds spontaneously appear**. So regardless of what imgur is doing, Discourse must be doing something weird as well.

For example, when I click edit in one of my posts, the gallery appears

 ![cf0fa3ab62374fdf0c6656cc2661220e83a359c3](https://global.discourse-cdn.com/meta/original/4X/f/9/9/f99ad0aa02498e58a689395b4c72bf268bcdc135.png)  
 ![3adbe6a412e5c52e0c5f2cd38df51448832aaf80](https://global.discourse-cdn.com/meta/original/4X/3/3/1/331efb93e87783dd1398bc5b0ab9963180e435fb.png)  
Similarly, when I paste a gallery link on the editor, it appears, but disappears after a carriage return.

 ![4b104d722b653ce1565a045054adbf73d9c6bc3d](https://global.discourse-cdn.com/meta/original/4X/8/1/b/81bff76e58358d9240e9b70c7c128a13c2beefda.png)  
 ![fc52352c64421a5de5e31c4b5e9c5a2010437f3a](https://global.discourse-cdn.com/meta/original/4X/9/5/d/95dc88f5db3a67afa7067d04d86cc193b6b40eac.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 3, 2015, 10:29pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/7 "2015-08-03T22:29:21Z")

</div>

Is this a timing issue in the composer, does typing a bit more kick it out of crazy mode ?

---

<div class="post-metadata">

### Author: ![anonymous234](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@anonymous234](https://meta.discourse.org/u/anonymous234)
#### Post date: [August 4, 2015, 4:15pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/8 "2015-08-04T16:15:05Z")

</div>

Not really, in fact right now I can’t even get it to appear at all.

[[Album] A dog, 8 birds and cute hamster best friends ever - Album on Imgur ![](https://global.discourse-cdn.com/meta/original/4X/7/a/c/7ac1430d7d6f270700f9ed63daf6618c20631b9f.jpeg "A dog, 8 birds and cute hamster best friends ever - Album on Imgur") ](https://imgur.com/a/CBxba)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [August 4, 2015, 7:10pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/9 "2015-08-04T19:10:32Z")

</div>

@sam imgur embeds are using a `<script>` tag which gets excised from the final post by the html-sanitizer-bundle, but if you edit the post the script is loaded. we need a custom onebox for imgur albums.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 4, 2015, 11:05pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/10 "2015-08-04T23:05:59Z")

</div>

We should do this as Imgur is a customer. Can you add it to your list @techapj?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [August 4, 2015, 11:07pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/11 "2015-08-04T23:07:30Z")

</div>

To be fair, it would’ve gotten done anyways, eventually. 😛

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [August 5, 2015, 10:54am UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/12 "2015-08-05T10:54:28Z")

</div>

Okay, I just added custom Imgur onebox engine. Here are the features:

- When Imgur _image link_ is provided, it extracts the image and shows that, clicking on image will take you to original imgur link.

[![Imgur](https://global.discourse-cdn.com/meta/original/3X/5/a/5a7f48b2652b4582704506d34266ed01643de1cc.jpeg "Deadpool Trailer") ](https://imgur.com/gallery/uN1SCcs)

- When Imgur _gif link_ is provided, it extracts the mp4 video source and shows the HTML5 video player (with controls/autoplay/loop).

- When Imgur _gallery link_ is provided, it extracts the _first image_ from the gallery and shows that, clicking on image will take you to original imgur gallery link.

[[Album] I came across a pet adoption event near my office today ![](https:?fb "I came across a pet adoption event near my office today") ](https://imgur.com/a/iVrLa)

* * *

[https://github.com/discourse/onebox/commit/9526fb1fa79aac912a920439b97058ccb7d4c438](https://github.com/discourse/onebox/commit/9526fb1fa79aac912a920439b97058ccb7d4c438)

(cc @eviltrout)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [August 5, 2015, 4:16pm UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/13 "2015-08-05T16:16:06Z")

</div>



---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [August 6, 2015, 11:13am UTC](https://meta.discourse.org/t/imgur-embeds-broken/29869/14 "2015-08-06T11:13:57Z")

</div>

A post was split to a new topic: [Imgur album should have some indication that it’s an album](https://meta.discourse.org/t/imgur-album-should-have-some-indication-that-its-an-album/31823)
