download strategy docs, fix tests

This commit is contained in:
Jesse Bannon 2022-11-08 21:48:50 -08:00
parent c7b21dde1f
commit 0641a308ab
4 changed files with 17 additions and 6 deletions

View file

@ -39,13 +39,13 @@ download strategy has its own set of parameters.
url
'''
.. autoclass:: ytdl_sub.downloaders.generic.url.UrlDownloadOptions()
:members:
:members: url, playlist_thumbnails, source_thumbnails
:member-order: bysource
multi_url
'''''''''
.. autoclass:: ytdl_sub.downloaders.generic.multi_url.MultiUrlDownloadOptions()
:members:
:members: urls
:member-order: bysource
-------------------------------------------------------------------------------
@ -119,6 +119,7 @@ audio_extract
.. autoclass:: ytdl_sub.plugins.audio_extract.AudioExtractOptions()
:members:
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -127,6 +128,7 @@ chapters
.. autoclass:: ytdl_sub.plugins.chapters.ChaptersOptions()
:members:
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -135,12 +137,14 @@ date_range
.. autoclass:: ytdl_sub.plugins.date_range.DateRangeOptions()
:members:
:member-order: bysource
:exclude-members: partial_validate
file_convert
''''''''''''
.. autoclass:: ytdl_sub.plugins.file_convert.FileConvertOptions()
:members:
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -148,6 +152,7 @@ music_tags
''''''''''
.. autoclass:: ytdl_sub.plugins.music_tags.MusicTagsOptions()
:members:
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -156,6 +161,7 @@ nfo_tags
.. autoclass:: ytdl_sub.plugins.nfo_tags.NfoTagsOptions()
:members: nfo_name, nfo_root, tags, kodi_safe
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -164,6 +170,7 @@ output_directory_nfo_tags
.. autoclass:: ytdl_sub.plugins.output_directory_nfo_tags.OutputDirectoryNfoTagsOptions()
:members: nfo_name, nfo_root, tags, kodi_safe
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -175,6 +182,7 @@ regex
.. autoclass:: ytdl_sub.plugins.regex.SourceVariableRegex()
:members: match, capture_group_names, capture_group_defaults
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -183,6 +191,7 @@ split_by_chapters
.. autoclass:: ytdl_sub.plugins.split_by_chapters.SplitByChaptersOptions()
:members: when_no_chapters
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -191,6 +200,7 @@ subtitles
.. autoclass:: ytdl_sub.plugins.subtitles.SubtitleOptions()
:members: subtitles_name, subtitles_type, embed_subtitles, languages, allow_auto_generated_subtitles
:member-order: bysource
:exclude-members: partial_validate
-------------------------------------------------------------------------------
@ -198,6 +208,7 @@ video_tags
''''''''''
.. autoclass:: ytdl_sub.plugins.video_tags.VideoTagsOptions()
:members:
:exclude-members: partial_validate
-------------------------------------------------------------------------------

View file

@ -550,7 +550,7 @@ class Downloader(DownloadArchiver, Generic[DownloaderOptionsT], ABC):
) -> Iterable[Entry] | Iterable[Tuple[Entry, FileMetadata]]:
"""The function to perform the download of all media entries"""
# download the bottom-most urls first since they are top-priority
for collection_url in reversed(self.collection.collection_urls.list):
for collection_url in reversed(self.collection.urls.list):
parents, orphan_entries = self._download_url_metadata(collection_url=collection_url)
collection_url_entries: List[Entry] = []

View file

@ -173,7 +173,7 @@ class MultiUrlValidator(StrictDictValidator, AddsVariablesMixin):
self._urls = self._validate_key(key="urls", validator=UrlListValidator)
@property
def collection_urls(self) -> UrlListValidator:
def urls(self) -> UrlListValidator:
"""
Required. The Soundcloud user's url, i.e. ``soundcloud.com/the_username``
"""
@ -205,7 +205,7 @@ class MultiUrlValidator(StrictDictValidator, AddsVariablesMixin):
)
# Apply formatting to each new source variable, ensure it resolves
for collection_url in self.collection_urls.list:
for collection_url in self.urls.list:
for (
source_var_name,
source_var_formatter_str,

View file

@ -144,7 +144,7 @@ class YoutubeMergePlaylistDownloader(Downloader[YoutubeMergePlaylistDownloaderOp
def download(self) -> List[Tuple[Entry, FileMetadata]]:
"""Download a single Youtube video, then split it into multiple videos"""
url = self.overrides.apply_formatter(self.collection.collection_urls.list[0].url)
url = self.overrides.apply_formatter(self.collection.urls.list[0].url)
entry_dict = self.extract_info(url=url)
merged_video = self._to_merged_video(entry_dict=entry_dict)