避免参数中有空格导致异常

This commit is contained in:
2021-09-02 20:48:10 +08:00
parent 0787d24014
commit 519e70cad0
3 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,7 @@ template_current_video = {
}
current_line = ""
with open("../a.txt", "r", encoding="GB2312") as f:
with open("a.txt", "r", encoding="GB2312") as f:
skip_current = False
current_video_params = copy.deepcopy(template_current_video)
for current_line in f.readlines():
@ -23,11 +23,11 @@ with open("../a.txt", "r", encoding="GB2312") as f:
skip_current = False
else:
os.system(" ".join([
"ffmpeg", "-y", "-i", "{filename}.{file_ext}".format_map(current_video_params),
"ffmpeg", "-y", "-i", "\"{filename}.{file_ext}\"".format_map(current_video_params),
"-c copy", "-f {pack_ext}".format_map(current_video_params),
"-ss","{start}".format_map(current_video_params),
"-to","{end}".format_map(current_video_params),
"{target_name}{suffix}.{out_ext}".format_map(current_video_params),
"\"{target_name}{suffix}.{out_ext}\"".format_map(current_video_params),
]))
current_video_params = copy.deepcopy(template_current_video)
continue