Skip to content

Commit 814ed57

Browse files
authored
rework char list that requires quoting into a list
1 parent 68dc551 commit 814ed57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

client/grpc-ffmpeg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
USE_SSL = os.getenv('USE_SSL', 'false').lower() == 'true'
1515
# Add any params here that need quoting on their values
1616
parameters_to_quote = ['-filter_complex', '-vf', '-hls_segment_filename', '-user_agent']
17+
chars_that_need_quoting = [' ', ',', ':', '(', ')']
1718

1819
async def run_command(command, use_ssl):
1920
target = f"{GRPC_HOST}:{GRPC_PORT}"
@@ -56,7 +57,7 @@ def handle_quoted_arguments(command_args):
5657
file_path = file_path_arg[len('file:'):] # Extract the actual file path
5758

5859
# Quote the file path if it contains spaces or special characters
59-
if any(char in next_arg for char in [' ', ',', ':', '(', ')']):
60+
if any(char in next_arg for char in chars_that_need_quoting):
6061
file_path = f'"{file_path}"'
6162

6263
# Reassemble the -i file: argument
@@ -69,7 +70,7 @@ def handle_quoted_arguments(command_args):
6970
next_arg = command_args[i + 1]
7071

7172
# Quote the argument value if it contains spaces, commas, or colons
72-
if any(char in next_arg for char in [' ', ',', ':', '(', ')']):
73+
if any(char in next_arg for char in chars_that_need_quoting):
7374
next_arg = f'"{next_arg}"'
7475

7576
rffmpeg_command.append(arg)

0 commit comments

Comments
 (0)