Text twiddles

This commit is contained in:
Jamie Hardt
2023-11-08 18:44:23 -08:00
parent 4f3ea72c98
commit d75e55e870

View File

@@ -8,7 +8,8 @@ FFPROBE = 'ffprobe'
def ffprobe(path):
arguments = [FFPROBE, "-of", "json", "-show_format", "-show_streams", path]
arguments = [FFPROBE, "-of", "json",
"-show_format", "-show_streams", path]
if int(sys.version[0]) < 3:
process = subprocess.Popen(arguments, stdout=PIPE)
process.wait()
@@ -20,7 +21,8 @@ def ffprobe(path):
else:
return None
else:
process = subprocess.run(arguments, stdin=None, stdout=PIPE, stderr=PIPE)
process = subprocess.run(arguments, stdin=None,
stdout=PIPE, stderr=PIPE)
if process.returncode == 0:
output_str = process.stdout.decode('utf-8')
return json.loads(output_str)