mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 22:21:17 +01:00
parent
b07897ef5b
commit
66cf3e1001
|
@ -577,14 +577,16 @@ def _options(target_ext):
|
||||||
|
|
||||||
|
|
||||||
class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
|
class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
|
||||||
|
SUPPORTED_EXTS = ('mp4', 'mov', 'm4a', 'webm', 'mkv', 'mka')
|
||||||
|
|
||||||
def __init__(self, downloader=None, already_have_subtitle=False):
|
def __init__(self, downloader=None, already_have_subtitle=False):
|
||||||
super().__init__(downloader)
|
super().__init__(downloader)
|
||||||
self._already_have_subtitle = already_have_subtitle
|
self._already_have_subtitle = already_have_subtitle
|
||||||
|
|
||||||
@PostProcessor._restrict_to(images=False)
|
@PostProcessor._restrict_to(images=False)
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
if info['ext'] not in ('mp4', 'webm', 'mkv'):
|
if info['ext'] not in self.SUPPORTED_EXTS:
|
||||||
self.to_screen('Subtitles can only be embedded in mp4, webm or mkv files')
|
self.to_screen(f'Subtitles can only be embedded in {", ".join(self.SUPPORTED_EXTS)} files')
|
||||||
return [], info
|
return [], info
|
||||||
subtitles = info.get('requested_subtitles')
|
subtitles = info.get('requested_subtitles')
|
||||||
if not subtitles:
|
if not subtitles:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user