aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-11-13 17:30:33 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-11-13 17:32:07 +0530
commit7c7f7161fc0d778cd74d8b89162ba9df3d4e5da8 (patch)
treec5c75dd0128c3372960a6d2230fc649a85402fe5
parente339d25a0d0d5de7e237e6ff8c7676aaa2cbb8a8 (diff)
downloadhypervideo-pre-7c7f7161fc0d778cd74d8b89162ba9df3d4e5da8.tar.lz
hypervideo-pre-7c7f7161fc0d778cd74d8b89162ba9df3d4e5da8.tar.xz
hypervideo-pre-7c7f7161fc0d778cd74d8b89162ba9df3d4e5da8.zip
Fix `--load-info-json` of playlists with failed entries
-rw-r--r--yt_dlp/YoutubeDL.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 1b3873254..70106db7e 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1504,10 +1504,12 @@ class YoutubeDL(object):
if 'entries' not in ie_result:
raise EntryNotInPlaylist('There are no entries')
+
+ MissingEntry = object()
incomplete_entries = bool(ie_result.get('requested_entries'))
if incomplete_entries:
def fill_missing_entries(entries, indices):
- ret = [None] * max(indices)
+ ret = [MissingEntry] * max(indices)
for i, entry in zip(indices, entries):
ret[i - 1] = entry
return ret
@@ -1561,7 +1563,7 @@ class YoutubeDL(object):
entry = None
try:
entry = get_entry(i)
- if entry is None:
+ if entry is MissingEntry:
raise EntryNotInPlaylist()
except (IndexError, EntryNotInPlaylist):
if incomplete_entries:
@@ -1655,7 +1657,6 @@ class YoutubeDL(object):
self.report_error(
'Skipping the remaining entries in playlist "%s" since %d items failed extraction' % (playlist, failures))
break
- # TODO: skip failed (empty) entries?
playlist_results.append(entry_result)
ie_result['entries'] = playlist_results