mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
Revert "[ffmpeg] Set ffmpeg_location
in a contextvar"
This reverts commit 6a7d3a0a09
.
This commit is contained in:
parent
b76e9cedb3
commit
bf6bdf22de
2 changed files with 2 additions and 15 deletions
|
@ -1,8 +1,4 @@
|
||||||
try:
|
f'You are using an unsupported version of Python. Only Python versions 3.7 and above are supported by yt-dlp' # noqa: F541
|
||||||
import contextvars # noqa: F401
|
|
||||||
except Exception:
|
|
||||||
raise Exception(
|
|
||||||
f'You are using an unsupported version of Python. Only Python versions 3.7 and above are supported by yt-dlp') # noqa: F541
|
|
||||||
|
|
||||||
__license__ = 'Public Domain'
|
__license__ = 'Public Domain'
|
||||||
|
|
||||||
|
@ -25,7 +21,6 @@
|
||||||
from .postprocessor import (
|
from .postprocessor import (
|
||||||
FFmpegExtractAudioPP,
|
FFmpegExtractAudioPP,
|
||||||
FFmpegMergerPP,
|
FFmpegMergerPP,
|
||||||
FFmpegPostProcessor,
|
|
||||||
FFmpegSubtitlesConvertorPP,
|
FFmpegSubtitlesConvertorPP,
|
||||||
FFmpegThumbnailsConvertorPP,
|
FFmpegThumbnailsConvertorPP,
|
||||||
FFmpegVideoConvertorPP,
|
FFmpegVideoConvertorPP,
|
||||||
|
@ -907,11 +902,6 @@ def _real_main(argv=None):
|
||||||
if print_extractor_information(opts, all_urls):
|
if print_extractor_information(opts, all_urls):
|
||||||
return
|
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:
|
with YoutubeDL(ydl_opts) as ydl:
|
||||||
pre_process = opts.update_self or opts.rm_cachedir
|
pre_process = opts.update_self or opts.rm_cachedir
|
||||||
actual_use = all_urls or opts.load_info_filename
|
actual_use = all_urls or opts.load_info_filename
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import collections
|
import collections
|
||||||
import contextvars
|
|
||||||
import itertools
|
import itertools
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
@ -83,8 +82,6 @@ class FFmpegPostProcessorError(PostProcessingError):
|
||||||
|
|
||||||
|
|
||||||
class FFmpegPostProcessor(PostProcessor):
|
class FFmpegPostProcessor(PostProcessor):
|
||||||
_ffmpeg_location = contextvars.ContextVar('ffmpeg_location', default=None)
|
|
||||||
|
|
||||||
def __init__(self, downloader=None):
|
def __init__(self, downloader=None):
|
||||||
PostProcessor.__init__(self, downloader)
|
PostProcessor.__init__(self, downloader)
|
||||||
self._prefer_ffmpeg = self.get_param('prefer_ffmpeg', True)
|
self._prefer_ffmpeg = self.get_param('prefer_ffmpeg', True)
|
||||||
|
@ -104,7 +101,7 @@ def get_versions(downloader=None):
|
||||||
def _determine_executables(self):
|
def _determine_executables(self):
|
||||||
programs = [*self._ffmpeg_to_avconv.keys(), *self._ffmpeg_to_avconv.values()]
|
programs = [*self._ffmpeg_to_avconv.keys(), *self._ffmpeg_to_avconv.values()]
|
||||||
|
|
||||||
location = self.get_param('ffmpeg_location', self._ffmpeg_location.get())
|
location = self.get_param('ffmpeg_location')
|
||||||
if location is None:
|
if location is None:
|
||||||
return {p: p for p in programs}
|
return {p: p for p in programs}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue