新pc

发布时间 2023-07-26 10:19:55作者: hacker_dvd
with open('p1.mp4', 'wb') as file:
    with open('dash.json', 'r', encoding='utf-8') as f:
        json_data = f.read()
        dt = json.loads(json_data)
        m3u8 = dt['data']['program']['video'][4]['m3u8']
        print(m3u8)
        url_lst = re.findall(r'http://.*', m3u8)
        for ts_url in url_lst:
            res = requests.get(url=ts_url)
            file.write(res.content)