import json from RequestUrl import get_url import execjs import re
defget_information(url): respon = get_url(url) information = re.findall(r'<script>window.__INITIAL_STATE__=(.*?)</script>', respon.text, re.S)[0] if information == '': print('拜年祭网址解析失败') return0
information = re.sub(r';\(.*\);', '', information) information = json.loads(information)
api = f'https://api.bilibili.com/x/player/wbi/playurl?avid={avid}&bvid={bvid}&cid={cid}&qn=80&fnver=0&fnval=4048&fourk=1&gaia_source=&from_client=BROWSER&session=&voice_balance=1&web_location=1315873&w_rid={w_rid}&wts={wts}' return api