better docs

This commit is contained in:
Jesse Bannon 2022-11-10 23:55:56 -08:00
parent f215f99c65
commit 5a3b06d25f

View file

@ -85,30 +85,13 @@ class UrlValidator(StrictDictValidator):
""" """
return self._variables return self._variables
@property
def source_thumbnails(self) -> Optional[UrlThumbnailListValidator]:
"""
Thumbnails to download from the source, if any exist. The hierarchy is defined as
source -> playlist -> entry.
Usage:
.. code-block:: yaml
source_thumbnails:
- name: "poster.jpg"
uid: "avatar_uncropped"
UID is the yt-dlp thumbnail ID or can specify ``latest_entry`` to use the last entry's
thumbnail that was downloaded.
"""
return self._source_thumbnails
@property @property
def playlist_thumbnails(self) -> Optional[UrlThumbnailListValidator]: def playlist_thumbnails(self) -> Optional[UrlThumbnailListValidator]:
""" """
Thumbnails to download from the source, if any exist. The hierarchy is defined as Thumbnails to download from the playlist, if any exist. Playlist is the ``yt-dlp`` naming
source -> playlist -> entry. convention for a set that contains multiple entries. For example, the URL
``https://www.youtube.com/c/RickastleyCoUkOfficial`` would have ``playlist`` refer to the
channel.
Usage: Usage:
@ -117,12 +100,41 @@ class UrlValidator(StrictDictValidator):
playlist_thumbnails: playlist_thumbnails:
- name: "poster.jpg" - name: "poster.jpg"
uid: "avatar_uncropped" uid: "avatar_uncropped"
- name: "fanart.jpg"
uid: "banner_uncropped"
UID is the yt-dlp thumbnail ID or can specify ``latest_entry`` to use the last entry's ``name`` is the file name relative to the output directory to store the thumbnail.
thumbnail that was downloaded. ``uid`` is the yt-dlp thumbnail ID. Can specify ``latest_entry`` to use the latest entry's
thumbnail.
""" """
return self._playlist_thumbnails return self._playlist_thumbnails
@property
def source_thumbnails(self) -> Optional[UrlThumbnailListValidator]:
"""
Thumbnails to download from the source, if any exist. Source in this context refers to the
set of sets. For example, the URL
``https://www.youtube.com/c/RickastleyCoUkOfficial/playlists``
would have ``playlist`` refer to each individual playlist, whereas ``source`` refers
to the channel.
Usage:
.. code-block:: yaml
source_thumbnails:
- name: "poster.jpg"
uid: "avatar_uncropped"
- name: "fanart.jpg"
uid: "banner_uncropped"
``name`` is the file name relative to the output directory to store the thumbnail.
``uid`` is the yt-dlp thumbnail ID. Can specify ``latest_entry`` to use the latest entry's
thumbnail.
"""
return self._source_thumbnails
class UrlListValidator(ListValidator[UrlValidator]): class UrlListValidator(ListValidator[UrlValidator]):
_inner_list_type = UrlValidator _inner_list_type = UrlValidator