圆月山庄资源网 Design By www.vgjia.com
代码如下所示:
import os import requests import datetime from Crypto.Cipher import AES def decode_key_file(key_file_name): with open(key_file_name,"r") as f: data=f.read() return data def decode_m_file(m_file_name): with open(m_file_name,"r") as f: data=f.read() return data.split("\n")[6::2] def decode_video(filename): data_list=[[],[],[]] file_list=os.listdir(filename) for one_file_name in file_list: if "m3u8" in one_file_name: data_list[0].append(filename+"/"+one_file_name) elif "key" in one_file_name: data_list[1].append(filename + "/" + one_file_name) else: data_list[2].append(filename + "/" + one_file_name) key=decode_key_file(data_list[1][0]) name_list=decode_m_file(data_list[0][0]) for one_name in name_list: for path_name in data_list[2]: if one_name in path_name: with open(path_name,"rb") as f: data_name=f.read() if len(key): # AES 解密 cryptor = AES.new(key, AES.MODE_CBC, key) with open(key + ".mp4", 'ab') as f: f.write(cryptor.decrypt(data_name)) if __name__ == '__main__': decode_video("./data")
视频下载下来如下图所示
https://ngmov.me/"text-align: center">
改进版本
def decode_key_file(key_file_name): with open(key_file_name, "r") as f: data = f.read() return data def decode_m_file(m_file_name): with open(m_file_name, "r") as f: data = f.read() return data.split("\n")[6::2] def decode_video(filename): data_list = [[], [], []] file_list = os.listdir(filename) for one_file_name in file_list: if "m3u8" in one_file_name: data_list[0].append(filename + "/" + one_file_name) elif "key" in one_file_name: data_list[1].append(filename + "/" + one_file_name) else: data_list[2].append(filename + "/" + one_file_name) try: key = decode_key_file(data_list[1][0]) except: key = one_file_name name_list = decode_m_file(data_list[0][0]) for one_name in name_list: for path_name in data_list[2]: if one_name in path_name: with open(path_name, "rb") as f: data_name = f.read() if len(key): # AES 解密 cryptor = AES.new(key, AES.MODE_CBC, key) with open(key + ".mp4", 'ab') as f: f.write(cryptor.decrypt(data_name)) else: with open(key + ".mp4", 'ab') as f: f.write(data_name) f.flush() if __name__ == '__main__': data_list = os.listdir("/home/dfy/Videos/Download") index=0 for path_one in data_list: index+=1 if index<18: continue decode_video("/home/dfy/Videos/Download" + "/" + path_one)
圆月山庄资源网 Design By www.vgjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
圆月山庄资源网 Design By www.vgjia.com
暂无评论...
更新日志
2024年11月01日
2024年11月01日
- 《暗喻幻想》顺风耳作用介绍
- 崔健1985-梦中的倾诉[再版][WAV+CUE]
- 黄子馨《追星Xin的恋人们2》HQ头版限量编号[WAV+CUE]
- 孟庭苇《情人的眼泪》开盘母带[低速原抓WAV+CUE]
- 孙露《谁为我停留HQCD》[低速原抓WAV+CUE][1.1G]
- 孙悦《时光音乐会》纯银CD[低速原抓WAV+CUE][1.1G]
- 任然《渐晚》[FLAC/分轨][72.32MB]
- 英雄联盟新英雄安蓓萨上线了吗 新英雄安蓓萨技能介绍
- 魔兽世界奥杜尔竞速赛什么时候开启 奥杜尔竞速赛开启时间介绍
- 无畏契约CGRS准星代码多少 CGRS准星代码分享一览
- 张靓颖.2012-倾听【少城时代】【WAV+CUE】
- 游鸿明.1999-五月的雪【大宇国际】【WAV+CUE】
- 曹方.2005-遇见我【钛友文化】【WAV+CUE】
- Unity6引擎上线:稳定性提升、CPU性能最高提升4倍
- 人皇Sky今日举行婚礼!电竞传奇步入新篇章