Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问嵌入的视频不能播放正常吗。。。。 #26

Open
17183248569 opened this issue Dec 24, 2023 · 7 comments
Open

请问嵌入的视频不能播放正常吗。。。。 #26

17183248569 opened this issue Dec 24, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@17183248569
Copy link

图片
确实能显示预览图,但是进度一直是0:00/0:00。也不能开始播放。。。

@Dobby233Liu
Copy link
Owner

Dobby233Liu commented Feb 4, 2024

外观是正常的,行为也符合预期。OpenGraph信息中提供的视频文件链接是b站的嵌入式播放器,但是让为了Discord端显示一个伪视频嵌入,对它的蜘蛛我们将链接的mimetype谎报成video/mp4而非text/html(这个行为是仿造某个小众视频网站vidlii的)。Discord貌似有一个白名单,youtube的嵌入式播放器是可以通过Opengraph嵌入的,但是b站的嵌入式播放器,即使mimetype正确,视频播放器也不会被嵌入,embed反而还会缩小。

一种解决方法:

  • 对Discord端不发送视频文件链接,把twitter 卡片类型改为summary_card_large
  • 实现一个根据cid跳转到b站视频cdn的接口,对Discord端发送的视频文件链接改为使用那个接口( https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md )这个有点复杂,可能要改用一个真正的bilibili api库我才想起来为什么我不这么搞了,”WEB 端取流需要验证防盗链,即referer为 .bilibili.com域名下且 UA 不能为空“,通过vercel也镜像不了视频流

伪视频嵌入上面的标题还是可以点的,会跳转到视频页

@Dobby233Liu Dobby233Liu added the enhancement New feature or request label Feb 4, 2024
@17183248569
Copy link
Author

也就是说,在b看来这很可能是一个盗链行为,因此不让。。。。除非整一个服务器把浏览器请求和视频给做一个中转?

@Dobby233Liu
Copy link
Owner

Dobby233Liu commented May 17, 2024

除非整一个服务器把浏览器请求和视频给做一个中转?

本人没有能力搞这个

最近突发奇想,可能还有一个解决方法,可以学tiktok 例如 https://www.tiktok.com/t/ZTLbPHfBN/ ,在预览图上粘一个假的播放按钮

@Ecstaticoder
Copy link

Any updates to this @Dobby233Liu?

@Dobby233Liu
Copy link
Owner

Any updates to this @Dobby233Liu?

I'm going with the first approach I mentioned here. For cobalt integration I don't know what instance to use (can't really host one)

@Dobby233Liu
Copy link
Owner

image
The deed is done, not sure whether to close this issue or not though

@Ecstaticoder
Copy link

Ecstaticoder commented Nov 17, 2024

Any updates to this @Dobby233Liu?

I'm going with the first approach I mentioned here. For cobalt integration I don't know what instance to use (can't really host one)

I think for instances, use the main instance then add in a backup instance (of your choice) just in case the main one fails to work. So with that it should always work if one instance is at least working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants