better docs

This commit is contained in:
Jesse Bannon 2022-11-10 22:08:01 -08:00
parent 0641a308ab
commit ea51387888
3 changed files with 16 additions and 4 deletions

View file

@ -12,6 +12,7 @@ clean:
build/ \
dist/ \
src/ytdl_sub.egg-info/ \
docs/_html/ \
.coverage \
coverage.xml

View file

@ -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
-------------------------------------------------------------------------------

View file

@ -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