mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-17 20:06:28 +00:00
[ffmpeg] Set ffmpeg_location
in a contextvar
Fixes #2191 for the CLI, but not when used through the API
This commit is contained in:
@@ -19,6 +19,7 @@ from .extractor.adobepass import MSO_INFO
|
||||
from .extractor.common import InfoExtractor
|
||||
from .options import parseOpts
|
||||
from .postprocessor import (
|
||||
FFmpegPostProcessor,
|
||||
FFmpegExtractAudioPP,
|
||||
FFmpegSubtitlesConvertorPP,
|
||||
FFmpegThumbnailsConvertorPP,
|
||||
@@ -899,6 +900,11 @@ def _real_main(argv=None):
|
||||
if print_extractor_information(opts, all_urls):
|
||||
return
|
||||
|
||||
# We may need ffmpeg_location without having access to the YoutubeDL instance
|
||||
# See https://github.com/yt-dlp/yt-dlp/issues/2191
|
||||
if opts.ffmpeg_location:
|
||||
FFmpegPostProcessor._ffmpeg_location.set(opts.ffmpeg_location)
|
||||
|
||||
with YoutubeDL(ydl_opts) as ydl:
|
||||
pre_process = opts.update_self or opts.rm_cachedir
|
||||
actual_use = all_urls or opts.load_info_filename
|
||||
|
Reference in New Issue
Block a user