b站有个ai字幕,可以调用那个做歌词,虽然有的视频没有ai字幕。 #137
lanbingyue1
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
@wood3n 大佬你看看,这是一个做歌词的思路,虽然ai识别的不太准确,以及有视频没有ai字幕,但可以凑凑数先用着。 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
下面是我查了一下午的ai字幕接口的使用方式。
aid和cid测试发现是必须的。
第一步:使用get请求->https://api.bilibili.com/x/player/wbi/v2?aid=233907326&cid=1280044181
需要复制再请求
会获得一串json,json中的subtitle里面的subtitles,subtitles里面的subtitle_url便是该视频的ai字幕url。
第二步:使用get请求该视频的ai字幕url会得到一个json。
该json的格式:
"font_size": 0.4,
"font_color": "#FFFFFF",
"background_alpha": 0.5,
"background_color": "#9C27B0",
"Stroke": "none",
"type": "AIsubtitle",
"lang": "zh",
"version": "v1.5.0.4",
"body": [
{
"from": 16.079,
"to": 17.669,
"sid": 1,
"location": 2,
"content": "♪ 是否很惊讶 ♪",
"music": 0.9999999285714336
},...
body里面的就是字幕的数据 "from": 16.079, "to": 17.669,代表开始和结束
Beta Was this translation helpful? Give feedback.
All reactions