14
14
USE_SSL = os .getenv ('USE_SSL' , 'false' ).lower () == 'true'
15
15
# Add any params here that need quoting on their values
16
16
parameters_to_quote = ['-filter_complex' , '-vf' , '-hls_segment_filename' , '-user_agent' ]
17
+ chars_that_need_quoting = [' ' , ',' , ':' , '(' , ')' ]
17
18
18
19
async def run_command (command , use_ssl ):
19
20
target = f"{ GRPC_HOST } :{ GRPC_PORT } "
@@ -56,7 +57,7 @@ def handle_quoted_arguments(command_args):
56
57
file_path = file_path_arg [len ('file:' ):] # Extract the actual file path
57
58
58
59
# 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 ):
60
61
file_path = f'"{ file_path } "'
61
62
62
63
# Reassemble the -i file: argument
@@ -69,7 +70,7 @@ def handle_quoted_arguments(command_args):
69
70
next_arg = command_args [i + 1 ]
70
71
71
72
# 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 ):
73
74
next_arg = f'"{ next_arg } "'
74
75
75
76
rffmpeg_command .append (arg )
0 commit comments