[DOCS] Add more configuration docs (#916)

This commit is contained in:
Jesse Bannon 2024-02-02 22:52:17 -08:00 committed by GitHub
parent 29616144b4
commit cea21ca47f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 125 additions and 42 deletions

View file

@ -0,0 +1,15 @@
=======================
Common
=======================
.. highlight:: yaml
Media Quality
-------------
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/helpers/media_quality.yaml
Only Recent Videos
------------------
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/helpers/download_deletion_options.yaml

View file

@ -1,7 +0,0 @@
=======================
Common Preset Reference
=======================
.. highlight:: yaml
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/helpers/common.yaml

View file

@ -1,7 +0,0 @@
========================
Players Preset Reference
========================
.. highlight:: yaml
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/helpers/players.yaml

View file

@ -1,7 +0,0 @@
====================
URL Preset Reference
====================
.. highlight:: yaml
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/helpers/url.yaml

View file

@ -7,6 +7,6 @@ This section contains the code for the prebuilt presets. If you just want to und
.. toctree:: .. toctree::
helpers_common common
helpers_players tv_show
helpers_url music

View file

@ -0,0 +1,9 @@
=====
Music
=====
All audio music based presets inherit from ``_music_base``.
.. highlight:: yaml
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/music/singles.yaml

View file

@ -0,0 +1,9 @@
========================
TV Show
========================
All TV show based presets inherit from ``_episode_base``.
.. highlight:: yaml
.. literalinclude:: /../../src/ytdl_sub/prebuilt_presets/tv_show/episode.yaml

View file

@ -16,6 +16,41 @@ The layout of the ``config.yaml`` file is relatively straightforward:
plugin1: plugin1:
plugin1_option1: value1 plugin1_option1: value1
This creates a preset named ``preset_name``, which contains the made-up
:doc:`plugin </config_reference/plugins>` ``plugin1``. Under each plugin are its settings.
A preset can contain multiple plugins.
Preset Inheritance Preset Inheritance
------------------ ------------------
You can modularize your presets via preset inheritance. For example,
.. code-block:: yaml
presets:
TV Show:
presets:
- "Jellyfin TV Show by Date"
overrides:
tv_show_directory: "/ytdl_sub_tv_shows"
TV Show Only Recent:
presets:
- "TV Show"
- "Only Recent"
overrides:
only_recent_date_range: "3weeks"
This creates two presets:
* ``TV Show``
* Inherits the :doc:`prebuilt </prebuilt_presets/index>` ``Jellyfin TV Show by Date`` preset
* Sets the output tv show directory
* ``TV Show Only Recent``
* Inherits the ``TV Show`` preset made above it and the ``Only Recent`` prebuilt preset
* Sets only_recent preset to only keep the last 3 weeks worth of videos
Inheritance makes it easy to extend existing presets to include logic for your specific needs.

View file

@ -9,6 +9,14 @@ Your first configuration will look pretty simple:
configuration: configuration:
working_directory: '.ytdl-sub-downloads' working_directory: '.ytdl-sub-downloads'
presets:
TV Show:
preset:
- "Jellyfin TV Show by Date"
- "Only Recent"
overrides:
tv_show_directory: "/ytdl_sub_tv_shows"
The first two lines in this ``config.yaml`` file are the ``configuration``, and define the ``working_directory``, which is described near the bottom of :ref:`this section <guides/getting_started/index:quick overview of \`\`ytdl-sub\`\`>` The first two lines in this ``config.yaml`` file are the ``configuration``, and define the ``working_directory``, which is described near the bottom of :ref:`this section <guides/getting_started/index:quick overview of \`\`ytdl-sub\`\`>`

View file

@ -1,18 +1,8 @@
presets: presets:
"Only Recent": #############################################################################
preset: # Only Recent Archive
- "Only Recent Archive" # Downloads only `date_range` amount of videos (no deletion)
# Only fetch videos after today minus date_range
# Only keep files uploaded after date_range
output_options:
keep_files_after: "today-{only_recent_date_range}"
keep_max_files: "{only_recent_max_files}"
overrides:
only_recent_max_files: 0
"Only Recent Archive": "Only Recent Archive":
# Only fetch videos after today minus date_range # Only fetch videos after today minus date_range
@ -24,8 +14,28 @@ presets:
date_range: "2months" # keep for legacy-reasons date_range: "2months" # keep for legacy-reasons
only_recent_date_range: "{date_range}" only_recent_date_range: "{date_range}"
#############################################################################
# Only Recent
# Downloads only `date_range` amount of videos and deletes older videos
# that fall out of that range
chunk_initial_download: "Only Recent":
preset:
- "Only Recent Archive"
output_options:
keep_files_after: "today-{only_recent_date_range}"
keep_max_files: "{only_recent_max_files}"
overrides:
only_recent_max_files: 0
#############################################################################
# Download in Chunks
# Will only download 20 videos per invocation of ytdl-sub, starting
# at the very beginning of the channel
chunk_initial_download: # legacy preset name
ytdl_options: ytdl_options:
max_downloads: 20 max_downloads: 20
playlistreverse: True playlistreverse: True

View file

@ -1,5 +1,9 @@
presets: presets:
#############################################################################
# Best Video Quality
# Gets the best available quality
best_video_quality: best_video_quality:
format: "bestvideo+bestaudio/best" format: "bestvideo+bestaudio/best"
ytdl_options: ytdl_options:
@ -9,18 +13,26 @@ presets:
preset: preset:
- best_video_quality - best_video_quality
#############################################################################
# Max 2160p
"Max 2160p": "Max 2160p":
format: "(bv*[height<=2160]+bestaudio/best[height<=2160])" format: "(bv*[height<=2160]+bestaudio/best[height<=2160])"
ytdl_options: ytdl_options:
merge_output_format: "mp4" merge_output_format: "mp4"
#############################################################################
# Max 1440p
"Max 1440p": "Max 1440p":
format: "(bv*[height<=1440]+bestaudio/best[height<=1440])" format: "(bv*[height<=1440]+bestaudio/best[height<=1440])"
ytdl_options: ytdl_options:
merge_output_format: "mp4" merge_output_format: "mp4"
max_1080p: #############################################################################
# Max 1080p
max_1080p: # legacy name
format: "(bv*[height<=1080]+bestaudio/best[height<=1080])" format: "(bv*[height<=1080]+bestaudio/best[height<=1080])"
ytdl_options: ytdl_options:
merge_output_format: "mp4" merge_output_format: "mp4"
@ -29,11 +41,17 @@ presets:
preset: preset:
- max_1080p - max_1080p
#############################################################################
# Max 720p
"Max 720p": "Max 720p":
format: "(bv*[height<=720]+bestaudio/best[height<=720])" format: "(bv*[height<=720]+bestaudio/best[height<=720])"
ytdl_options: ytdl_options:
merge_output_format: "mp4" merge_output_format: "mp4"
#############################################################################
# Max 480p
"Max 480p": "Max 480p":
format: "(bv*[height<=480]+bestaudio/best[height<=480])" format: "(bv*[height<=480]+bestaudio/best[height<=480])"
ytdl_options: ytdl_options: