update docs
This commit is contained in:
parent
2cf0a76a48
commit
6d7ef1b4bb
2 changed files with 23 additions and 13 deletions
|
|
@ -203,6 +203,14 @@ regex
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
subtitles
|
||||||
|
'''''''''
|
||||||
|
.. autoclass:: ytdl_sub.plugins.subtitles.SubtitleOptions()
|
||||||
|
:members: subtitles_name, subtitles_type, embed_subtitles, languages, allow_auto_generated_subtitles
|
||||||
|
:member-order: bysource
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
.. _subscription_yaml:
|
.. _subscription_yaml:
|
||||||
|
|
||||||
subscription.yaml
|
subscription.yaml
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ class SubtitlesTypeValidator(StringSelectValidator):
|
||||||
|
|
||||||
class SubtitleOptions(PluginOptions):
|
class SubtitleOptions(PluginOptions):
|
||||||
"""
|
"""
|
||||||
Defines how to download and store subtitles.
|
Defines how to download and store subtitles. Using this plugin creates two new variables:
|
||||||
|
``lang`` and ``subtitles_ext``. ``lang`` is dynamic since you can download multiple subtitles.
|
||||||
|
It will set the respective language to the correct subtitle file.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
|
|
@ -41,14 +43,11 @@ class SubtitleOptions(PluginOptions):
|
||||||
presets:
|
presets:
|
||||||
my_example_preset:
|
my_example_preset:
|
||||||
subtitle_options:
|
subtitle_options:
|
||||||
# required
|
subtitles_name: "{title_sanitized}.{lang}.{subtitle_ext}"
|
||||||
output_directory: "/path/to/videos_or_music"
|
subtitles_type: "srt"
|
||||||
file_name: "{title_sanitized}.{ext}"
|
embed_subtitles: False
|
||||||
# optional
|
languages: "en" # supports list of multiple languages
|
||||||
thumbnail_name: "{title_sanitized}.{thumbnail_ext}"
|
allow_auto_generated_subtitles: False
|
||||||
maintain_download_archive: True
|
|
||||||
keep_files_before: now
|
|
||||||
keep_files_after: 19000101
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_optional_keys = {
|
_optional_keys = {
|
||||||
|
|
@ -81,15 +80,16 @@ class SubtitleOptions(PluginOptions):
|
||||||
def subtitles_name(self) -> Optional[StringFormatterValidator]:
|
def subtitles_name(self) -> Optional[StringFormatterValidator]:
|
||||||
"""
|
"""
|
||||||
Optional. The file name for the media's subtitles if they are present. This can include
|
Optional. The file name for the media's subtitles if they are present. This can include
|
||||||
directories such as ``"Season {upload_year}/{title}.{subtitle_ext}"``, and will be placed
|
directories such as ``"Season {upload_year}/{title_sanitized}.{lang}.{subtitle_ext}"``, and
|
||||||
in the output directory.
|
will be placed in the output directory. ``lang`` is dynamic since you can download multiple
|
||||||
|
subtitles. It will set the respective language to the correct subtitle file.
|
||||||
"""
|
"""
|
||||||
return self._subtitles_name
|
return self._subtitles_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def subtitles_type(self) -> Optional[str]:
|
def subtitles_type(self) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Optional. The subtitles file format. Defaults to ``srt``
|
Optional. One of the subtitle file types "srt", "vtt", "ass", "lrc". Defaults to "srt"
|
||||||
"""
|
"""
|
||||||
return self._subtitles_type
|
return self._subtitles_type
|
||||||
|
|
||||||
|
|
@ -97,13 +97,15 @@ class SubtitleOptions(PluginOptions):
|
||||||
def embed_subtitles(self) -> Optional[bool]:
|
def embed_subtitles(self) -> Optional[bool]:
|
||||||
"""
|
"""
|
||||||
Optional. Whether to embed the subtitles into the video file. Defaults to False.
|
Optional. Whether to embed the subtitles into the video file. Defaults to False.
|
||||||
|
NOTE: webm files can only embed "vtt" subtitle types.
|
||||||
"""
|
"""
|
||||||
return self._embed_subtitles
|
return self._embed_subtitles
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def languages(self) -> Optional[List[str]]:
|
def languages(self) -> Optional[List[str]]:
|
||||||
"""
|
"""
|
||||||
Optional. Language(s) to download for subtitles. Defaults to ``en``
|
Optional. Language code(s) to download for subtitles. Supports a single or list of multiple
|
||||||
|
language codes. Defaults to "en".
|
||||||
"""
|
"""
|
||||||
return [lang.value for lang in self._languages]
|
return [lang.value for lang in self._languages]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue