[Python] 纯文本查看 复制代码 import requests
import json
import jsonpath as jp
bvid = 'BV1SV411W7fD'
cid_back = requests.get("http://api.bilibili.com/x/player/pagelist?bvid={}".format(bvid))
cid_json = json.loads((cid_back.content))
cid = jp.jsonpath(cid_json,"$..cid")[0]
sub_back = requests.get("http://api.bilibili.com/x/web-interface/view?bvid={}&cid={}".format(bvid, cid))
sub_json = json.loads((sub_back.content))
subtitle = jp.jsonpath(sub_json,"$..subtitle_url")[0]
print(subtitle)
提供一个python代码可以获取字幕列表的第一个字幕的js地址。记得要获取某些地区的js要坐飞机 |