# Vimeo onebox 对未列出视频不再有效

**URL:** <https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225>\
**Category:** Bug\
**Created:** [2023年四月1日 19:07 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225 "2023-04-01T19:07:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2023年四月1日 19:07 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/1 "2023-04-01T19:07:47Z")

</div>

这是一个未列出的视频：[https://vimeo.com/795669787/0763fdb816](https://vimeo.com/795669787/0763fdb816)

如果我尝试将 URL 单独粘贴以嵌入视频，视频似乎不存在 🤔

[![](https://i.vimeocdn.com/video/1602645154-56e0101b545c38ae03e9bc65ae12c3bcc37cd8ea127d359c0d24cf8ab31f8675-d?f=webpion=us "Energy Distribution - Feb 2023") ](https://vimeo.com/795669787/0763fdb816)

这以前一直没问题——不确定是什么时候坏的——也许是 Vimeo 更改了什么？

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2023年四月1日 19:08 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/2 "2023-04-01T19:08:22Z")

</div>

![Screenshot 2023-04-01 at 20.07.57](https://global.discourse-cdn.com/meta/original/4X/8/8/5/885237b648292f59642f2149d4038f9009249be1.png)

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2023年四月1日 19:14 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/3 "2023-04-01T19:14:25Z")

</div>

供参考，使用 Vimeo 的嵌入代码确实有效（尽管是在一个非常小、糟糕的 iframe 中）：

 ![Screenshot 2023-04-01 at 20.13.23](https://global.discourse-cdn.com/meta/original/4X/2/e/3/2e3e039ab2ba0a96a8faf481df9feae3e970b8f2.jpeg)

但是，未列出视频的原生嵌入功能已失效 😕

---

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2023年四月1日 22:25 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/4 "2023-04-01T22:25:28Z")

</div>

嗯，看起来 URL 被截断了：🤔

![image](https://global.discourse-cdn.com/meta/original/4X/b/e/1/be15a37abadbefa70905e39671f45d3bcf7c748f.png)

这种带有第二个哈希的 URL 格式似乎与未列出的视频有关。

~~从我看到的情况来看，它似乎无法处理这种情况：~~  
~~[https://github.com/discourse/onebox/blob/main/lib/onebox/engine/vimeo\_onebox.rb~~](https://github.com/discourse/onebox/blob/main/lib/onebox/engine/vimeo_onebox.rb~~)  
~~也许可以依赖 `oembed_data` 输出中的 `uri` 值来解决。即使只有视频 ID，它也会给出 `/videos/795669787:0763fdb816`，然后你将 `:` 字符替换为 `/`。~~

_编辑：抱歉，我没注意，我看到的是旧的仓库_ 🫠

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年四月1日 23:43 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/5 "2023-04-01T23:43:55Z")

</div>

看起来像是一个回归 @jancernik

---

<div class="post-metadata">

**Author:** ![jancernik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancernik/32/275892_2.png) [@jancernik](https://meta.discourse.org/u/jancernik)\
**Post date:** [2023年四月4日 02:04 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/11 "2023-04-04T02:04:46Z")

</div>

您好 @Richie，感谢您报告此问题。这是由于我们最近对处理某些嵌入内容的方式进行了更改。我们刚刚在此处合并了一个修复程序：

> <https://github.com/discourse/discourse/pull/20916>
>
> There was an issue with embedding private Vimeo videos because the URL differs f…rom regular uploads. This issue can be fixed, but it turns out that Vimeo's oembed response is much more limited for unlisted videos, and attributes such as the thumbnail URL are not available. ~Therefore, this PR disables lazy-videos for private uploads, they will render as regular onebox embeds instead.~
> 
> This PR adds support for unlisted Vimeo videos. The only downside is that some videos will not render a thumbnail. However, in some cases they will (e.g., https://vimeo.com/192207770/0faf1dd09d). I'm guessing that this has something to do with the privacy settings.

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2023年四月4日 16:52 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/12 "2023-04-04T16:52:17Z")

</div>

感谢 @jancernik 快速修复！

太棒了 😃

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年四月8日 07:00 UTC](https://meta.discourse.org/t/vimeo-onebox-for-unlisted-videos-no-longer-works/260225/13 "2023-04-08T07:00:32Z")

</div>

该主题已自动关闭，持续 4 天。不再允许回复。
