1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[ytdl] simplify '_process_entries()'

This commit is contained in:
Mike Fährmann 2024-09-03 21:16:30 +02:00
parent 4a3a255ddc
commit 6f611de889
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -116,22 +116,18 @@ class YoutubeDLExtractor(Extractor):
for entry in entries:
if not entry:
continue
elif entry.get("_type") in ("url", "url_transparent"):
if entry.get("_type") in ("url", "url_transparent"):
try:
info_dict = ytdl_instance.extract_info(
entry = ytdl_instance.extract_info(
entry["url"], False,
ie_key=entry.get("ie_key"))
except ytdl_module.utils.YoutubeDLError:
continue
if not info_dict:
if not entry:
continue
elif "entries" in info_dict:
yield from self._process_entries(
ytdl_module, ytdl_instance, info_dict["entries"])
else:
yield info_dict
elif "entries" in entry:
if "entries" in entry:
yield from self._process_entries(
ytdl_module, ytdl_instance, entry["entries"])
else: