[cleanup] Misc fixes and cleanup

Closes #3780, Closes #3853, Closes #3850
This commit is contained in:
pukkandan 2022-05-27 04:36:23 +05:30
parent 8246f8402b
commit 8a82af3511
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
16 changed files with 103 additions and 84 deletions

View file

@ -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')