搜索视频字幕信息

优质
小牛编辑
121浏览
2023-12-01

通过该接口可以根据关键词搜索单个视频的字幕信息,音频转写后可用,地址为:http://spark.bokecc.com/api/subtitle/search/video

需要传递以下参数:

参数说明
userid用户 id,不可为空
videoid视频 id,不可为空
q查询的关键词,不可为空
num_per_page返回信息时,每页包含的字幕信息条数 注:允许范围为1~100
page当前页码
format返回格式,xml 或 json

返回数据subtiles包括如下字段:

字段名说明
total返回字幕信息条数
subtitle字幕信息

subtile包括如下字段:

字段名说明
bg开始位置,单位:毫秒
ed结束位置,单位:毫秒
content字幕内容

XML格式的返回信息如下:

<?xmlversion="1.0"encoding="UTF-8"?>

<subtitles>

<total>20</total>

   <subtitle>

       <bg>3000</bg>

   <ed>4000</ed>

   <content>abc</content>

   </subtitle>

   <subtitle>

       <bg>5000</bg>

   <ed>6000</ed>

   <content>abd</content>

   </subtitle>

   …

</subtitle>

JSON格式的返回信息如下:

{

"subtitles":{

"total":20

"subtitle":[

{

"bg":3000,    

"ed":4000,

"content":"abc",      

},

{

"bg":5000,    

"ed":6000,

"content":"abd",      

},

           …

]

}

}