diff --git a/Makefile b/Makefile index e650882e..272ccc76 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ clean: build/ \ dist/ \ src/ytdl_sub.egg-info/ \ + docs/_html/ \ .coverage \ coverage.xml diff --git a/docs/config.rst b/docs/config.rst index d04837fa..a059c45b 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -36,6 +36,8 @@ download_strategy Download strategies dictate what is getting downloaded from a source. Each download strategy has its own set of parameters. +.. _url: + url ''' .. autoclass:: ytdl_sub.downloaders.generic.url.UrlDownloadOptions() @@ -45,8 +47,7 @@ url multi_url ''''''''' .. autoclass:: ytdl_sub.downloaders.generic.multi_url.MultiUrlDownloadOptions() - :members: urls - :member-order: bysource + :members: urls, variables ------------------------------------------------------------------------------- diff --git a/src/ytdl_sub/downloaders/generic/validators.py b/src/ytdl_sub/downloaders/generic/validators.py index 6c172abc..0b345f2f 100644 --- a/src/ytdl_sub/downloaders/generic/validators.py +++ b/src/ytdl_sub/downloaders/generic/validators.py @@ -71,7 +71,7 @@ class UrlValidator(StrictDictValidator): @property def url(self) -> OverridesStringFormatterValidator: """ - URL to download from, listed in priority from lowest (top) to highest (bottom). If a + Required. URL to download from, listed in priority from lowest (top) to highest (bottom). If a download exists in more than one URL, it will resolve to the bottom-most one and inherit those variables. """ @@ -175,10 +175,20 @@ class MultiUrlValidator(StrictDictValidator, AddsVariablesMixin): @property def urls(self) -> UrlListValidator: """ - Required. The Soundcloud user's url, i.e. ``soundcloud.com/the_username`` + Required. A list of :ref:`url` with the addition of the ``variables`` attribute. """ return self._urls + @property + def variables(self) -> DictFormatterValidator: + """ + Optional. Source variables to add to each entry downloaded from its respective :ref:`url`. The top-most + :ref:`url` must define all possible variables. Other :ref:`url` entries can redefine all of them or a subset of + the top-most variables. + """ + # keep for readthedocs documentation + return self._urls.list[0].variables + def added_source_variables(self) -> List[str]: """ Returns