lint, max iter 3
This commit is contained in:
parent
95bc839294
commit
1061570d51
3 changed files with 4 additions and 4 deletions
|
|
@ -404,7 +404,6 @@ class MultiUrlDownloader(SourcePlugin[MultiUrlValidator]):
|
|||
)
|
||||
|
||||
parents = EntryParent.from_entry_dicts(
|
||||
url=url,
|
||||
entry_dicts=entry_dicts,
|
||||
working_directory=self.working_directory,
|
||||
include_sibling_metadata=include_sibling_metadata,
|
||||
|
|
|
|||
|
|
@ -238,15 +238,17 @@ class YTDLP:
|
|||
cls.logger.info("MaxDownloadsReached, stopping additional downloads.")
|
||||
|
||||
# For YouTube playlists in particular, channel metadata is not fetched. Attempt to get
|
||||
# channel metadata via grabbing uploader_url info json
|
||||
# channel metadata via grabbing uploader_url info json a max of 3 times
|
||||
current_iter = 0
|
||||
url = kwargs.get("url")
|
||||
uploader_url = parent_dict.get("uploader_url")
|
||||
while uploader_url and url != uploader_url:
|
||||
while current_iter < 3 and uploader_url and url != uploader_url:
|
||||
cls.logger.debug("Attempting to get parent metadata from URL %s", uploader_url)
|
||||
parent_dict = cls.extract_info(
|
||||
ytdl_options_overrides=ytdl_options_overrides | {"playlist_items": "0:0"},
|
||||
url=uploader_url,
|
||||
)
|
||||
current_iter += 1
|
||||
url = uploader_url
|
||||
uploader_url = parent_dict.get("uploader_url")
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,6 @@ class EntryParent(BaseEntry):
|
|||
@classmethod
|
||||
def from_entry_dicts(
|
||||
cls,
|
||||
url: str,
|
||||
entry_dicts: List[Dict],
|
||||
working_directory: str,
|
||||
include_sibling_metadata: bool,
|
||||
|
|
|
|||
Loading…
Reference in a new issue