[utils] Deprecate encodeArgument (#17621)

Authored by: doe1080
This commit is contained in:
doe1080
2026-12-01 05:08:32 +00:00
committed by GitHub
parent 9370822e3b
commit 7b9efbd9a9
7 changed files with 20 additions and 36 deletions
+3 -4
View File
@@ -11,7 +11,6 @@ from ..utils import (
Popen,
PostProcessingError,
check_executable,
encodeArgument,
prepend_extension,
shell_quote,
)
@@ -155,11 +154,11 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
self.to_screen('mutagen was not found. Falling back to AtomicParsley')
cmd = [atomicparsley,
filename,
encodeArgument('--artwork'),
'--artwork',
thumbnail_filename,
encodeArgument('-o'),
'-o',
temp_filename]
cmd += [encodeArgument(o) for o in self._configuration_args('AtomicParsley')]
cmd += self._configuration_args('AtomicParsley')
self._report_run('atomicparsley', filename)
self.write_debug(f'AtomicParsley command line: {shell_quote(cmd)}')
+10 -17
View File
@@ -20,7 +20,6 @@ from ..utils import (
detect_exe_version,
determine_ext,
dfxp2srt,
encodeArgument,
filter_dict,
float_or_none,
is_outdated_version,
@@ -235,14 +234,10 @@ class FFmpegPostProcessor(PostProcessor):
raise PostProcessingError('ffprobe and ffmpeg not found. Please install or provide the path using --ffmpeg-location')
try:
if use_ffprobe:
cmd = [
self.probe_executable,
encodeArgument('-show_streams')]
cmd = [self.probe_executable, '-show_streams']
basename = self.probe_basename
else:
cmd = [
self.executable,
encodeArgument('-i')]
cmd = [self.executable, '-i']
basename = self.basename
cmd.append(self._ffmpeg_filename_argument(path))
self.write_debug(f'{basename} command line: {shell_quote(cmd)}')
@@ -278,11 +273,11 @@ class FFmpegPostProcessor(PostProcessor):
cmd = [
self.probe_executable,
encodeArgument('-hide_banner'),
encodeArgument('-show_format'),
encodeArgument('-show_streams'),
encodeArgument('-print_format'),
encodeArgument('json'),
'-hide_banner',
'-show_format',
'-show_streams',
'-print_format',
'json',
]
cmd += opts
@@ -332,10 +327,10 @@ class FFmpegPostProcessor(PostProcessor):
oldest_mtime = min(
os.stat(path).st_mtime for path, _ in input_path_opts if path)
cmd = [self.executable, encodeArgument('-y')]
cmd = [self.executable, '-y']
# avconv does not have repeat option
if self.basename == 'ffmpeg':
cmd += [encodeArgument('-loglevel'), encodeArgument('repeat+info')]
cmd += ['-loglevel', 'repeat+info']
def make_args(file, args, name, number):
keys = [f'_{name}{number}', f'_{name}']
@@ -346,9 +341,7 @@ class FFmpegPostProcessor(PostProcessor):
args += self._configuration_args(self.basename, keys)
if name == 'i':
args.append('-i')
return (
[encodeArgument(arg) for arg in args]
+ [self._ffmpeg_filename_argument(file)])
return [*args, self._ffmpeg_filename_argument(file)]
for arg_type, path_opts in (('i', input_path_opts), ('o', output_path_opts)):
cmd += itertools.chain.from_iterable(