From f6d7624f57b1034d07d06b49cc8d2dacd6407b06 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 28 Jan 2021 14:59:01 +0530 Subject: [PATCH] Partial solution for detecting existing files correctly even when extracting audio * Does not work when audio format is 'best' --- youtube_dlc/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youtube_dlc/__init__.py b/youtube_dlc/__init__.py index 23102e0c4..bb94389e5 100644 --- a/youtube_dlc/__init__.py +++ b/youtube_dlc/__init__.py @@ -350,6 +350,8 @@ def _real_main(argv=None): opts.postprocessor_args.setdefault('sponskrub', []) opts.postprocessor_args['default'] = opts.postprocessor_args['default-compat'] + audio_ext = opts.audioformat if (opts.extractaudio and opts.audioformat != 'best') else None + match_filter = ( None if opts.match_filter is None else match_filter_func(opts.match_filter)) @@ -469,7 +471,7 @@ def _real_main(argv=None): 'extract_flat': opts.extract_flat, 'mark_watched': opts.mark_watched, 'merge_output_format': opts.merge_output_format, - 'final_ext': opts.recodevideo or opts.remuxvideo, + 'final_ext': opts.recodevideo or opts.remuxvideo or audio_ext, 'postprocessors': postprocessors, 'fixup': opts.fixup, 'source_address': opts.source_address,