[bilibili] api url update.

This commit is contained in:
OneCloud 2023-12-16 23:17:22 +08:00
parent 9f38d7d76f
commit 30d6c642f9

View File

@ -100,7 +100,8 @@ class Bilibili(VideoExtractor):
appkey, sec = ''.join([chr(ord(i) + 2) for i in entropy[::-1]]).split(':') appkey, sec = ''.join([chr(ord(i) + 2) for i in entropy[::-1]]).split(':')
params = 'appkey=%s&cid=%s&otype=json&qn=%s&quality=%s&type=' % (appkey, cid, qn, qn) params = 'appkey=%s&cid=%s&otype=json&qn=%s&quality=%s&type=' % (appkey, cid, qn, qn)
chksum = hashlib.md5(bytes(params + sec, 'utf8')).hexdigest() chksum = hashlib.md5(bytes(params + sec, 'utf8')).hexdigest()
return 'https://interface.bilibili.com/v2/playurl?%s&sign=%s' % (params, chksum) return 'https://api.bilibili.com/x/player/wbi/v2?%s&sign=%s' % (params, chksum)
@staticmethod @staticmethod
def bilibili_live_api(cid): def bilibili_live_api(cid):