[ExtractAudio] Handle outtmpl without ext (#6005)

Authored by: carusocr
Closes #5968
pull/5822/head^2
Chris Caruso 2023-02-17 00:06:15 -08:00 zatwierdzone przez GitHub
rodzic 5e1a54f63e
commit f737fb16d8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 1 dodań i 6 usunięć

Wyświetl plik

@ -318,10 +318,6 @@ def validate_options(opts):
if outtmpl_default == '':
opts.skip_download = None
del opts.outtmpl['default']
if outtmpl_default and not os.path.splitext(outtmpl_default)[1] and opts.extractaudio:
raise ValueError(
'Cannot download a video and extract audio into the same file! '
f'Use "{outtmpl_default}.%(ext)s" instead of "{outtmpl_default}" as the output template')
def parse_chapters(name, value):
chapters, ranges = [], []

Wyświetl plik

@ -508,8 +508,7 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
if acodec != 'copy':
more_opts = self._quality_args(acodec)
# not os.path.splitext, since the latter does not work on unicode in all setups
temp_path = new_path = f'{path.rpartition(".")[0]}.{extension}'
temp_path = new_path = replace_extension(path, extension, information['ext'])
if new_path == path:
if acodec == 'copy':