diff --git a/ffprobe/ffprobe.py b/ffprobe/ffprobe.py index f1eb3dc..ad88fbf 100644 --- a/ffprobe/ffprobe.py +++ b/ffprobe/ffprobe.py @@ -4,11 +4,15 @@ import functools import operator import os -import pipes import platform import re import subprocess +try: + from shlex import quote as shell_quote +except ImportError: + from pipes import quote as shell_quote + from ffprobe.exceptions import FFProbeError @@ -31,7 +35,7 @@ def __init__(self, path_to_video): if platform.system() == 'Windows': cmd = ["ffprobe", "-show_streams", self.path_to_video] else: - cmd = ["ffprobe -show_streams " + pipes.quote(self.path_to_video)] + cmd = ["ffprobe -show_streams " + shell_quote(self.path_to_video)] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)