From d0d60e6c29c264abedf7c7149b22b36aebbc9886 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sat, 11 Oct 2025 14:10:46 -0700 Subject: [PATCH] fix unit test, docs --- docs/source/prebuilt_presets/helpers.rst | 41 ++++++++++++++++++++++++ tests/unit/config/test_config_file.py | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/docs/source/prebuilt_presets/helpers.rst b/docs/source/prebuilt_presets/helpers.rst index 86752ed4..4e952009 100644 --- a/docs/source/prebuilt_presets/helpers.rst +++ b/docs/source/prebuilt_presets/helpers.rst @@ -1,3 +1,6 @@ + + + ============== Helper Presets ============== @@ -194,3 +197,41 @@ to your subscription, like so: url: "https://youtube.com/@channel" resolution_assert_ignore_titles: - "This 360p Video Title" + +_url +---- + +All prebuilt presets share the same internal ``_multi_url`` preset which comes equipped with +a few available customizations. + +Sibling Metadata +~~~~~~~~~~~~~~~~ + +*Sibling* refers to any entry within the same *playlist*. For channel downloads, this would +imply **every** video that gets downloaded since yt-dlp treats the channel as the *playlist*. + +Setting the variable ``include_sibling_metadata`` will include all sibling metadata within +each individual entry's metadata. This is used specifically for music presets. When downloading +a playlist as an album for example, it will take the max year amongst all the other sibling's metadata +to have a consistent album year that can be used in file or directory naming. + +Webpage URL +~~~~~~~~~~~ + +``ytdl-sub`` performs downloads in two stages. + +1. Metadata scrape from the original URL +2. Individual entry downloads + +For step 2, ``ytdl-sub`` will use the ``webpage_url`` variable by default for the input URL to yt-dlp. +This can be modified in case it's not working as expected by using the variable ``modified_webpage_url``. + +Example: + +.. code-block:: yaml + :caption: + Removes yt-dlp smuggle data from the URL + + overrides: + modified_webpage_url: >- + { %regex_sub("#__youtubedl_smuggle=.*", "", webpage_url) } \ No newline at end of file diff --git a/tests/unit/config/test_config_file.py b/tests/unit/config/test_config_file.py index 1bed7504..ae1d2231 100644 --- a/tests/unit/config/test_config_file.py +++ b/tests/unit/config/test_config_file.py @@ -77,7 +77,7 @@ class TestConfigFilePartiallyValidatesPresets: expected_error_message="Validation error in partial_preset.download.1: " "'partial_preset.download.1' contains the field 'bad_key' which is not allowed. " "Allowed fields: download_reverse, include_sibling_metadata, playlist_thumbnails, " - "source_thumbnails, url, variables, ytdl_options", + "source_thumbnails, url, variables, webpage_url, ytdl_options", ) @pytest.mark.parametrize(