Skip to content

Commit a1ff13d

Browse files
committed
Quote path on unix environments
1 parent 7328b32 commit a1ff13d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ffprobe/ffprobe.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import re
1313
import sys
1414
import os
15+
import pipes
1516

1617
class FFProbe:
1718
"""
@@ -26,7 +27,12 @@ def __init__(self,video_file):
2627
except:
2728
raise IOError('ffprobe not found.')
2829
if os.path.isfile(video_file):
29-
p = subprocess.Popen(["ffprobe","-show_streams",self.video_file],stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True)
30+
if str(platform.system())=='Windows':
31+
cmd=["ffprobe","-show_streams",self.video_file]
32+
else:
33+
cmd=["ffprobe -show_streams "+pipes.quote(self.video_file)]
34+
35+
p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True)
3036
self.format=None
3137
self.created=None
3238
self.duration=None

0 commit comments

Comments
 (0)