]> jfr.im git - yt-dlp.git/commitdiff
Partial solution for detecting existing files correctly even when extracting audio
authorpukkandan <redacted>
Thu, 28 Jan 2021 09:29:01 +0000 (14:59 +0530)
committerpukkandan <redacted>
Thu, 28 Jan 2021 10:20:03 +0000 (15:50 +0530)
* Does not work when audio format is 'best'

youtube_dlc/__init__.py

index 23102e0c4dcd83610cc666345ca81ad853cea672..bb94389e5823fb4dbf301a3b56b0d364c540fc52 100644 (file)
@@ -350,6 +350,8 @@ def parse_retries(retries):
         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 parse_retries(retries):
         '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,