diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-07-30 23:47:14 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-07-31 02:20:12 +0530 |
commit | 6a7d3a0a0981d05903e70bcb31fc3f9438eedf22 (patch) | |
tree | 2ec5b3c9b61c69712e6376863cfca66f9ddb3b11 /yt_dlp/__init__.py | |
parent | c646d76f6717a646dd35f6efad6b396435f9fa55 (diff) |
[ffmpeg] Set `ffmpeg_location` in a contextvar
Fixes #2191 for the CLI, but not when used through the API
Diffstat (limited to 'yt_dlp/__init__.py')
-rw-r--r-- | yt_dlp/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 5b9b3541c..24f6153e0 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -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 |