Discourse-embed-bilibili(在discourse中插入哔哩哔哩视频)

How to use

just paste your bilibili url, like this

https://www.bilibili.com/video/BV1294y1b7Cx
https://www.bilibili.com/video/BV1294y1b7Cx/?spm_id_from=333.788

then you embed this video successfully bili测试 - 🗣️闲聊 - 始徒

如何使用本插件

在discourse中黏贴b站视频链接即可,如

https://www.bilibili.com/video/BV1294y1b7Cx
https://www.bilibili.com/video/BV1294y1b7Cx/?spm_id_from=333.788

插件会自动将链接解析成视频 bili测试 - 🗣️闲聊 - 始徒

Thanks for the author

I found the plugin by google about how to embed bilibili in discourse and got it in github, but i don’t found anything about the author in discourse meta forum

Anyway ,thanks for your help about bilibili

5 Likes

Hi, thanks for sharing this :slight_smile:

I had a quick look at it, and have a few remarks:

  • You can’t disable the plugin. There is no setting for this (the input is disabled).
    image
    To disable the plugin, you need to uninstall it.

  • You need to add https://player.bilibili.com in the allowed iframes site setting.

  • The videos from bilibili inside iframes are autoplay (:warning:).

This plugin would benefit from improvements.

2 Likes

Isn’t that explained in the first post? I understood it as a feature, so you can control whether you get a video onebox or a regular onebox.

2 Likes

Thanks, I removed these points from my post :slight_smile:

I don’t see it as a feature, the plugin’s regex only takes into account links that don’t have anything after video/ and the onebox is just the expected fallback for links that don’t match a onebox script pattern.

Arbitrarily adding a query string to display a regular onebox would be a weird way to control how a URL is displayed, though I agree that it would definitely be useful for this since the videos are autoplay.

3 Likes

thanks for your reply, i just want to embed bili video in my site, the method of add https://player.bilibili.com in the allowed iframes doesn’t work , i don’t know how to fix it

this is indeed a problem, but i don’t know how to add the function of disable plugin, i just can use it, don’t know how to modify the code

我知道怎么做,你去加个config就可以了。我等会要是有空给你提个PR。

upd:啊?这个不是你写的啊?那没办法了

这是我写的一个很简单的插件,你可以参考一下怎么加的config
Lhcfl/discourse-another-smtp (github.com)

我fork了一下,改了改正则表达式,现在也可以识别有参数的超链接了

我试着改了一下config,失败😂,每次修改再验证还得rebuild,太费时间了,等大佬有空直接pr吧🙏

i have fork and modify the regex code , urls with parameters are now recognized normally

Good job :+1:

When you’re happy with the result, I suggest you request access to Plugin authors - Discourse Meta and post your plugin in plugin :slight_smile:

另外写插件当然是要在开发环境下,rebuild也太麻烦了……

2 Likes

已经merge了,原来config里还要写设置的名称😂

请问怎么部署开发环境呀?

https://meta.discourse.org/tags/c/documentation/devs/56/dev-install

2 Likes

这个出来的很模糊吧··

b站前一段时间限制了站外嵌入视频的清晰度,详见

西瓜视频的外链比较好·

1 Like

原插件作者

试了下不能用,现在bilibili iframe 里面必须要有cid,aid了吗?还有没有方法能实现嵌入呢?

这个插件只会匹配bv号,其他内容会自动忽略,更多需要可以提交pr,菜鸟只能做到这样了

关于cid我查到一些资料,也许能帮助到你

1 Like

你好,这个现在还能用吗?好像不行了