當前位置:菜譜大全網 - 家常菜菜譜 - 芒果視頻

芒果視頻

導入請求

進口re

導入操作系統

導入json

url = ' /atcl '

標題= {

}

數據= {

}

Filename =' video \ '

如果不是os.path.exists(文件名):

os.mkdir(文件名)

response = requests . get(URL = URL,headers=headers,params=data)

m3 u8 _ data = requests . get(URL = reponse . JSON()[' info '],headers=headers)。文本

m3u8_data = re sub(# e . * ' ',m3 u8 _ data)。拆分()

對於m3u8_data中的索引:

ts _ URL = '/c 1/2021/11/15 _ 0/22 a2 ca 71 a3 ff 5097 ef 94512e 538 a60e 7 _ 20211115 _ 65438

ts _ data = requests . get(URL = ts _ URL,headers = headers)。內容

用open (f'{filename}/ I burn in .mp4 ',mode =' ab ')作為f:

f.write(ts_data)