Skip to content

Instantly share code, notes, and snippets.

@lmmsoft
Created June 10, 2023 10:54
Show Gist options
  • Save lmmsoft/72c4d2376288f987f21210b53b9074c8 to your computer and use it in GitHub Desktop.
Save lmmsoft/72c4d2376288f987f21210b53b9074c8 to your computer and use it in GitHub Desktop.
把百度云 .livp 格式的备份照片,解压成 jpg 和 mov 格式
import os
import zipfile
def unzip_files(dir_path):
"""解压指定目录下的所有 .livp 文件"""
files = os.listdir(dir_path)
for file_name in files:
if file_name.endswith('.livp'):
file_path = os.path.join(dir_path, file_name)
zip_file = zipfile.ZipFile(file_path)
zip_file.extractall(dir_path)
zip_file.close()
if __name__ == '__main__':
dir_path = input('请输入文件目录:')
unzip_files(dir_path)
print('所有 .lvip 文件解压完成!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment