异或缓存从而反译出能直接听的MP3文件
只是让歌曲在会员过期后仍然可以听,甚至离线听
原理也很简单,网易的缓存加密方法并不复杂,只需要异或一下字节即可用一些文本编辑器也是能实现这个操作的,但是Python脚本可以让这个过程简化,而这个脚本的目的也在于此…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| import os from datetime import datetime
input_folder_path = 'D:/Software Data/CloudMusic/Cache' output_folder_path = 'D:/Download'
file_info_list = [] for file in os.listdir(input_folder_path): if file.endswith('.uc'): file_path = os.path.join(input_folder_path, file) file_size = os.path.getsize(file_path) file_time = os.path.getmtime(file_path) file_date = datetime.fromtimestamp(file_time).strftime('%Y-%m-%d %H:%M:%S') file_info_list.append((file_path, file_size, file_time))
sorted_file_info_list = sorted(file_info_list, key=lambda x: -x[2])
for index, file_info in enumerate(sorted_file_info_list): print(f'{index+1}. {os.path.basename(file_info[0])} ({file_info[1]} bytes, {datetime.fromtimestamp(file_info[2]).strftime("%Y-%m-%d %H:%M:%S")})')
selected_file_index = int(input('请选择一个要处理的文件:')) - 1 selected_file_path = sorted_file_info_list[selected_file_index][0]
new_file_name = input('请输入新文件名:')
with open(selected_file_path, 'rb') as f: data = f.read() processed_data = bytearray([b ^ 0xA3 for b in data])
new_file_name = os.path.splitext(new_file_name)[0] + '.mp3' new_file_path = os.path.join(output_folder_path, new_file_name) with open(new_file_path, 'wb') as f: f.write(processed_data)
os.rename(new_file_path, os.path.join(output_folder_path, new_file_name))
|
可以通过bat运行…
1
| python -i D:\存储路径\ - \py文件路径\main.py
|