This commit is contained in:
Jesse Bannon 2024-12-21 09:09:13 -08:00
parent d7800a5c7c
commit 2fc2a31331
6 changed files with 31 additions and 89 deletions

View file

@ -7,9 +7,28 @@ to download in condensed YAML.
.. hint:: .. hint::
Read the :ref:`getting started guide <guides/getting_started:Getting Started>` Read the :ref:`getting started guide <guides/getting_started/index:Getting Started>`
first before reviewing this section. first before reviewing this section.
File Preset
-----------
Many examples show ``__preset__`` at the top. This is known as the *subscription file preset*.
It is where a single :ref:`preset <guides/getting_started/first_config:Custom Preset Definition>`
can be defined that gets applied to each subscription within the file.
This is a good place to apply file-wide variables such as ``tv_show_directory`` or
supply a cookies file path.
.. code-block:: yaml
__preset__:
overrides:
tv_show_directory: "/tv_shows"
ytdl_options:
cookiefile: "/config/cookie.txt"
Layout Layout
------ ------
A subscription file is comprised of YAML keys and values. Keys can be either A subscription file is comprised of YAML keys and values. Keys can be either

View file

@ -46,7 +46,7 @@ Oct 2023
subscription preset and value subscription preset and value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The use of ``__value__`` will go away in Dec 2023 in favor of the method found in The use of ``__value__`` will go away in Dec 2023 in favor of the method found in
:ref:`config_reference/subscriptions_yaml:beautifying subscriptions`. ``__preset__`` will still be supported for the time being. :ref:`config_reference/subscription_yaml:Subscription File`. ``__preset__`` will still be supported for the time being.
July 2023 July 2023
--------- ---------

View file

@ -1,56 +0,0 @@
Advanced Configuration
======================
If the :doc:`prebuilt presets </prebuilt_presets/index>` aren't suitable for your needs, you may want to set up an advanced configuration.
Layout of a Config file
-----------------------
The layout of the ``config.yaml`` file is relatively straightforward:
.. code-block:: yaml
presets:
preset_name:
plugin1:
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
------------------
You can modularize your presets via preset inheritance. For example,
.. code-block:: yaml
presets:
TV Show:
preset:
- "Jellyfin TV Show by Date"
overrides:
tv_show_directory: "/ytdl_sub_tv_shows"
TV Show Only Recent:
preset:
- "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

@ -150,7 +150,7 @@ Setting Override Variables
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: yaml .. code-block:: yaml
:lineno-start: 20 :lineno-start: 23
overrides: overrides:
tv_show_directory: "/ytdl_sub_tv_shows" tv_show_directory: "/ytdl_sub_tv_shows"
@ -187,7 +187,7 @@ Below shows a complete subscription file using the above two custom presets.
"Jake Trains": "https://www.youtube.com/@JakeTrains" "Jake Trains": "https://www.youtube.com/@JakeTrains"
TV Show Only Recent: TV Show Only Recent:
= News = News:
"BBC News": "https://www.youtube.com/@BBCNews" "BBC News": "https://www.youtube.com/@BBCNews"
Notice how we do not need to define ``tv_show_directory`` in the ``__preset__`` section Notice how we do not need to define ``tv_show_directory`` in the ``__preset__`` section

View file

@ -42,7 +42,7 @@ Let's break this down:
music_directory: "/music" music_directory: "/music"
The first :ref:`__preset__ <config_reference/subscriptions_yaml:File Preset>` section is where we The first :ref:`__preset__ <config_reference/subscription_yaml:File Preset>` section is where we
can set modifications that apply to every subscription in this file. can set modifications that apply to every subscription in this file.
This snippet specifically adds two :ref:`override <config_reference/plugins:Overrides>` variables, This snippet specifically adds two :ref:`override <config_reference/plugins:Overrides>` variables,
@ -96,8 +96,10 @@ Line 12 sets the key to ``= Documentaries``. When keys are prefixed with ``=``,
setting the genre. This value will get written to the respective metadata tags for both TV show setting the genre. This value will get written to the respective metadata tags for both TV show
and music presets. and music presets.
Behind the scenes, this sets the override variable ``subscription_indent_1``. Read more about Behind the scenes, this sets the override variable ``subscription_indent_1``. Further documentation
subscription syntax :ref:`here <config_reference/subscriptions_yaml:Subscriptions File>`. can be found here for
:ref:`subscription syntax <config_reference/subscription_yaml:Subscription File>` and
:ref:`subscription variables <config_reference/scripting/static_variables:Subscription Variables>`.
------------------------------------- -------------------------------------

View file

@ -45,36 +45,13 @@ Advanced terminology:
Ready to Start? Ready to Start?
--------------- ---------------
Now that you've completed your install of ``ytdl-sub``, it's time to get started. This is a 3-step process: Now that you've completed your install of ``ytdl-sub``, it's time to get started.
It is recommended to go through the below sections in order to fully grasp ytdl-sub.
- Create your subscription file
- Automate starting ytdl-sub
- (Optional) Create a custom configuration file if further customization is needed
:doc:`Step 1: Initial Subscriptions <first_sub>`
:doc:`Step 2: Your First Download <first_download>`
:doc:`Step 3: Automating Downloads <automating_downloads>`
Want to go a step further?
If you want to use atypical paths or specific configuration options, check out :doc:`Basic Configuration <first_config>`
For tips on creating your own presets when the prebuilt presets aren't cutting it, check out :doc:`Advanced Configuration <advanced_configuration>`
Other docs that may be of use:
:doc:`/prebuilt_presets/index`
.. toctree:: .. toctree::
:hidden: :maxdepth: 2
:caption: Getting Started Guide
:maxdepth: 1
first_sub first_sub
first_download first_download
automating_downloads automating_downloads
first_config first_config
advanced_configuration