Skip to content

Commit

Permalink
Merge pull request #12 from jeanslack/ffprobe_double_quotes
Browse files Browse the repository at this point in the history
fix ffprobe cmd pathname & filename quotes
  • Loading branch information
jeanslack committed Feb 18, 2022
2 parents 2d2c285 + 2c47a4d commit 6a92928
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
@@ -1,3 +1,10 @@
+--------------------------------+
February 17 2022 Version 1.0.8 Beta
+--------------------------------+

- Fixed double quotes on ffprobe command pathname.
- Fixed double quotes on filenames passed to ffprobe.

+--------------------------------+
February 06 2022 Version 1.0.7 Beta
+--------------------------------+
Expand Down
12 changes: 7 additions & 5 deletions ffcuesplitter/ffprobe.py
Expand Up @@ -7,7 +7,7 @@
Author: Gianluca Pernigotto <jeanlucperni@gmail.com>
Copyright: (c) 2022/2023 Gianluca Pernigotto <jeanlucperni@gmail.com>
license: GPL3
Rev: Feb.04.2021
Rev: Feb.17.2022
Code checker: flake8, pylint
########################################################
Expand All @@ -27,6 +27,7 @@
along with FFcuesplitter. If not, see <http://www.gnu.org/licenses/>.
"""
import subprocess
import shlex
import platform
import json
from ffcuesplitter.exceptions import FFProbeError
Expand Down Expand Up @@ -66,10 +67,11 @@ def ffprobe(filename, cmd='ffprobe', **kwargs):
etc,
)
"""
args = [cmd, '-show_format', '-show_streams', '-of', 'json']
args += from_kwargs_to_args(kwargs)
args += [filename]
args = ' '.join(args) if platform.system() == 'Windows' else args
args = (f'"{cmd}" -show_format -show_streams -of json '
f'{" ".join(from_kwargs_to_args(kwargs))} '
f'"{filename}"'
)
args = shlex.split(args) if platform.system() != 'Windows' else args

try:
with Popen(args,
Expand Down
4 changes: 2 additions & 2 deletions ffcuesplitter/info.py
Expand Up @@ -26,8 +26,8 @@
__maintainer__ = "Gianluca Pernigotto - Jeanslack"
__maintainer_contact__ = "jeanlucperni@gmail.com"
__copyleft__ = '2022'
__version__ = '1.0.7'
__release__ = 'February 05 2022'
__version__ = '1.0.8'
__release__ = 'February 17 2022'
__appname__ = "FFcuesplitter"
__packagename__ = "ffcuesplitter"
__license__ = "GPL3 (Gnu Public License)"
Expand Down

0 comments on commit 6a92928

Please sign in to comment.