aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2024-06-01 03:23:37 +0100
committerdirkf <fieldhouse@gmx.net>2024-06-11 12:52:13 +0100
commitb4ff08bd2d12b6c91f4d8c83a7820fc6db31033d (patch)
tree058eb69b9de7181856337cbc091a4f6b14b2604b /youtube_dl
parent88bd8b9f87f6f4956f11d32f3a7f23f20283357b (diff)
downloadyoutube-dl-b4ff08bd2d12b6c91f4d8c83a7820fc6db31033d.tar.xz
[core] Safer handling of nested playlist data
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/YoutubeDL.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 6f2aba5ac..a2b45859c 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -1039,8 +1039,8 @@ class YoutubeDL(object):
elif result_type in ('playlist', 'multi_video'):
# Protect from infinite recursion due to recursively nested playlists
# (see https://github.com/ytdl-org/youtube-dl/issues/27833)
- webpage_url = ie_result['webpage_url']
- if webpage_url in self._playlist_urls:
+ webpage_url = ie_result.get('webpage_url') # not all pl/mv have this
+ if webpage_url and webpage_url in self._playlist_urls:
self.to_screen(
'[download] Skipping already downloaded playlist: %s'
% ie_result.get('title') or ie_result.get('id'))
@@ -1048,6 +1048,10 @@ class YoutubeDL(object):
self._playlist_level += 1
self._playlist_urls.add(webpage_url)
+ new_result = dict((k, v) for k, v in extra_info.items() if k not in ie_result)
+ if new_result:
+ new_result.update(ie_result)
+ ie_result = new_result
try:
return self.__process_playlist(ie_result, download)
finally: