mirror of
https://github.com/joshuaboniface/rffmpeg.git
synced 2026-01-23 02:24:03 +00:00
Merge pull request #72 from JeWe37/master
This commit is contained in:
commit
a831afe59b
1 changed files with 3 additions and 10 deletions
13
rffmpeg
13
rffmpeg
|
|
@ -25,6 +25,7 @@ import logging
|
|||
import os
|
||||
import signal
|
||||
import sys
|
||||
import shlex
|
||||
import yaml
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
|
@ -471,16 +472,8 @@ def run_remote_command(
|
|||
stdout = sys.stderr
|
||||
else:
|
||||
stdout = sys.stdout
|
||||
|
||||
# Append all the passed arguments with requoting of any problematic characters
|
||||
for arg in command_args:
|
||||
# Escape $ characters
|
||||
arg = arg.replace('$', '\\$')
|
||||
# Match bad shell characters: * ' ( ) | [ ] or whitespace
|
||||
if search("[*'()|\[\]\s]", arg):
|
||||
rffmpeg_command.append(f'"{arg}"')
|
||||
else:
|
||||
rffmpeg_command.append(f"{arg}")
|
||||
|
||||
rffmpeg_command.extend(map(shlex.quote, command_args))
|
||||
|
||||
log.info(f"Running command on host '{target_hostname}' ({target_servername})")
|
||||
log.debug(f"Remote command: {' '.join(rffmpeg_ssh_command + rffmpeg_command)}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue