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测试 - 🗣️闲聊 - 始徒Beginner
How to use this plugin
In discourse, paste the Bilibili video link, for example
https://www.bilibili.com/video/BV1294y1b7Cx
https://www.bilibili.com/video/BV1294y1b7Cx/?spm_id_from=333.788
The plugin will automatically parse the link into a video bili测试 - 🗣️闲聊 - 始徒Beginner
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
6 Likes
Canapin
(Coin-coin le Canapin)
October 17, 2023, 8:58am
2
Hi, thanks for sharing this
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).
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 ( ).
This plugin would benefit from improvements.
3 Likes
Moin
October 17, 2023, 9:34am
3
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.
mocha3901:
if paste with parameters, like this
https://www.bilibili.com/video/BV1294y1b7Cx/?spm_id_from=333.788
there will be a summary of this website
2 Likes
Canapin
(Coin-coin le Canapin)
October 17, 2023, 9:41am
4
Thanks, I removed these points from my post
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
Coin-coin le Canapin:
You need to add https://player.bilibili.com in the allowed iframes site setting.
The videos from bilibili inside iframes are autoplay ( ).
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
Lhc_fl
(Linca)
October 18, 2023, 3:51am
7
mocha3901:
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
I know how to do it, just add a config. I’ll submit a PR if I have time later.
upd: Huh? You didn’t write this? Then there’s nothing I can do.
This is a very simple plugin I wrote, you can refer to it on how to add the config.
Lhcfl/discourse-another-smtp (github.com)
I forked it , modified the regular expression, and now it can also recognize hyperlinks with parameters.
I tried to modify the config, but failed . It takes too much time to rebuild every time I modify and verify. I’ll wait for a big shot to have time to directly PR .
Coin-coin le Canapin:
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.
i have fork and modify the regex code , urls with parameters are now recognized normally
Canapin
(Coin-coin le Canapin)
October 18, 2023, 9:03am
10
Good job
When you’re happy with the result, I suggest you request access to Plugin authors - Discourse Meta and post your plugin in plugin
Lhc_fl
(Linca)
October 18, 2023, 11:55am
11
master ← Lhcfl:master
opened 11:53AM - 18 Oct 23 UTC
Also, writing plugins should be done in a development environment, and rebuilding is too troublesome…
2 Likes
It has been merged. I didn’t realize I had to write the setting name in the config
How do I deploy the development environment?
Lhc_fl
(Linca)
October 19, 2023, 9:48am
13
2 Likes
zengyunsi
(运思 曾)
November 25, 2023, 1:00am
14
This is very blurry, isn’t it?
Bilibili recently restricted the clarity of videos embedded outside the site. See details at
https://www.zhihu.com/question/363423550
zengyunsi
(运思 曾)
November 28, 2023, 8:43am
16
Xigua Video’s external links are relatively good.
1 Like
Rick_Jing
(Rick Jing)
February 16, 2024, 12:00pm
18
Tried it, it doesn’t work. Does bilibili iframe now require cid and aid? Are there any other ways to achieve embedding?
This plugin only matches bv IDs, and other content will be automatically ignored. For more features, you can submit a PR. This is all I can do as a beginner.
mocha3901:
Just paste the Bilibili video link in Discourse, such as:
https://www.bilibili.com/video/BV1294y1b7Cx
https://www.bilibili.com/video/BV1294y1b7Cx/?spm_id_from=333.788
The plugin will automatically parse the link into a video.
Regarding CID, I found some information that might help you:
https://www.zhihu.com/question/400156620?utm_id=0
1 Like
joo
(slower)
April 2, 2024, 7:19am
20
Hello, can this still be used? It doesn’t seem to be working.