Merge pull request #132 from Fuchs4/fix-path

Fix path with spaces for mkvmerge
This commit is contained in:
Zen 2020-08-22 17:26:14 +03:00 committed by GitHub
commit 58a5cad0ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,12 +103,12 @@ def concatenate_mkvmerge(temp: Path, output):
log('Concatenating\n')
encode_files = sorted((temp / 'encode').iterdir())
concat = ' +'.join(f.as_posix() for f in encode_files)
concat = ' +'.join(shlex.quote(f.as_posix()) for f in encode_files)
audio_file = temp / "audio.mkv"
audio = audio_file.as_posix() if audio_file.exists() else ''
cmd = f' mkvmerge {concat} {audio} -o "{output}"'
cmd = f' mkvmerge {concat} {shlex.quote(audio)} -o {shlex.quote(output.as_posix())}'
concat = subprocess.Popen(cmd, stdout=PIPE, universal_newlines=True, shell=True)
output, err = concat.communicate()
concat.wait()