import os
import requests
import re
from multiprocessing import Pool
from Crypto.Cipher import AES
# 这个是你要保存的文件位置,可自定义,记得\\这个不要丢了,写这里是方便下面代码中不写。
path = r'E:\newfilm\\'
# 打开能播放你喜欢资源的网址,按F12,找到浏览器里XHR选项里m3u8文件,右键复制网址,记得选response 里面很多ts网址的。
m3u8 = 'https://youku-com.jjyl12349.com/20210517/BlYZo7Kz/1000kb/hls/index.m3u8'
def get_key(m3u8):
response = requests.get(m3u8).text
key_link = re.search('URI=\"(.*?)\"', response).group(1)
key = requests.get(key_link).text.encode('utf-8')
crypto = AES.new(key, AES.MODE_CBC, key)
return crypto
def get_tslist(m3u8):
response = requests.get(m3u8).text
ts_list = re.findall('https:.*?\.ts', response)
return ts_list
crypto = get_key(m3u8)
def down_ts(ts):
res = requests.get(ts).content
with open(path + ts.split('/')[-1], 'wb')as
爬取M3U8文件支持的网页在线播放资源(AES-128加密)
最新推荐文章于 2024-04-24 11:57:57 发布