as bilibili as target for embedable content
This commit is contained in:
parent
7551aa1fd4
commit
f4fa2ea4fa
2 changed files with 6 additions and 0 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -21,6 +21,7 @@
|
||||||
"autonumber",
|
"autonumber",
|
||||||
"bgutil",
|
"bgutil",
|
||||||
"bgutilhttp",
|
"bgutilhttp",
|
||||||
|
"bilibili",
|
||||||
"brainicism",
|
"brainicism",
|
||||||
"brotlicffi",
|
"brotlicffi",
|
||||||
"consoletitle",
|
"consoletitle",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,11 @@ const sources: EmbedSource[] = [
|
||||||
url: "https://www.dailymotion.com/embed/video/{id}",
|
url: "https://www.dailymotion.com/embed/video/{id}",
|
||||||
regex: /^.+dailymotion.com\/(video|hub)\/(?<id>[^_]+)[^#]*(#video=([^_&]+))?/,
|
regex: /^.+dailymotion.com\/(video|hub)\/(?<id>[^_]+)[^#]*(#video=([^_&]+))?/,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "bilibili",
|
||||||
|
url: "https://player.bilibili.com/player.html?aid=12569853&bvid={id}&cid=20681553&p=1&high_quality=1",
|
||||||
|
regex: /^https?:\/\/(?:www\.)?bilibili\.com\/video\/(?<id>BV[0-9A-Za-z]+)\/?/i,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const isEmbedable = (url: string): boolean => sources.some(source => source.regex.test(url))
|
const isEmbedable = (url: string): boolean => sources.some(source => source.regex.test(url))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue