Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

感谢up,我是下载的一整段视频,但是文件的名字都是数字,我更改了一点,如果需要自取 #2

Open
wyf1996 opened this issue Jun 4, 2023 · 0 comments

Comments

@wyf1996
Copy link

wyf1996 commented Jun 4, 2023

def changeFile(path, all_files): file_list = os.listdir(path) for file in file_list: cur_path = os.path.join(path, file) if os.path.isdir(cur_path): changeFile(cur_path, all_files) else: if os.path.splitext(file)[-1] == '.info': file = open(cur_path, "rb") fileJson = json.load(file) mp4 = fileJson['Aid']+'_'+os.path.basename(path)+'_0.mp4' mp4Path = os.path.join(path, mp4) pfile = open(mp4Path, 'rb') pfile.seek(3) byte = pfile.read() pfile.close() outName = '(' + \ os.path.basename(path)+')' + fileJson['PartName']+'.mp4' pfile = open(os.path.join(outpath, outName), 'wb') pfile.seek(0) pfile.write(byte) pfile.close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant