mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-25 02:45:16 +00:00
[cleanup] Misc fixes and cleanup
Closes #3780, Closes #3853, Closes #3850
This commit is contained in:
@@ -176,6 +176,8 @@ class PostProcessor(metaclass=PostProcessorMetaClass):
|
||||
|
||||
def report_progress(self, s):
|
||||
s['_default_template'] = '%(postprocessor)s %(status)s' % s
|
||||
if not self._downloader:
|
||||
return
|
||||
|
||||
progress_dict = s.copy()
|
||||
progress_dict.pop('info_dict')
|
||||
@@ -184,7 +186,8 @@ class PostProcessor(metaclass=PostProcessorMetaClass):
|
||||
progress_template = self.get_param('progress_template', {})
|
||||
tmpl = progress_template.get('postprocess')
|
||||
if tmpl:
|
||||
self._downloader.to_stdout(self._downloader.evaluate_outtmpl(tmpl, progress_dict))
|
||||
self._downloader.to_screen(
|
||||
self._downloader.evaluate_outtmpl(tmpl, progress_dict), skip_eol=True, quiet=False)
|
||||
|
||||
self._downloader.to_console_title(self._downloader.evaluate_outtmpl(
|
||||
progress_template.get('postprocess-title') or 'yt-dlp %(progress._default_template)s',
|
||||
|
||||
@@ -66,15 +66,6 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
self._prefer_ffmpeg = self.get_param('prefer_ffmpeg', True)
|
||||
self._paths = self._determine_executables()
|
||||
|
||||
def check_version(self):
|
||||
if not self.available:
|
||||
raise FFmpegPostProcessorError('ffmpeg not found. Please install or provide the path using --ffmpeg-location')
|
||||
|
||||
required_version = '10-0' if self.basename == 'avconv' else '1.0'
|
||||
if is_outdated_version(self._version, required_version):
|
||||
self.report_warning(f'Your copy of {self.basename} is outdated, update {self.basename} '
|
||||
f'to version {required_version} or newer if you encounter any errors')
|
||||
|
||||
@staticmethod
|
||||
def get_versions_and_features(downloader=None):
|
||||
pp = FFmpegPostProcessor(downloader)
|
||||
@@ -205,6 +196,15 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
if ext in ('mp4', 'mov', 'm4a'):
|
||||
yield from ('-c:s', 'mov_text')
|
||||
|
||||
def check_version(self):
|
||||
if not self.available:
|
||||
raise FFmpegPostProcessorError('ffmpeg not found. Please install or provide the path using --ffmpeg-location')
|
||||
|
||||
required_version = '10-0' if self.basename == 'avconv' else '1.0'
|
||||
if is_outdated_version(self._version, required_version):
|
||||
self.report_warning(f'Your copy of {self.basename} is outdated, update {self.basename} '
|
||||
f'to version {required_version} or newer if you encounter any errors')
|
||||
|
||||
def get_audio_codec(self, path):
|
||||
if not self.probe_available and not self.available:
|
||||
raise PostProcessingError('ffprobe and ffmpeg not found. Please install or provide the path using --ffmpeg-location')
|
||||
|
||||
Reference in New Issue
Block a user