Playlists maynot always have webpage_url

pull/5040/head
pukkandan 2 years ago
parent 5c8b2ee9ec
commit 0bd5a039ea
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

@ -1687,8 +1687,8 @@ class YoutubeDL:
elif result_type in ('playlist', 'multi_video'): elif result_type in ('playlist', 'multi_video'):
# Protect from infinite recursion due to recursively nested playlists # Protect from infinite recursion due to recursively nested playlists
# (see https://github.com/ytdl-org/youtube-dl/issues/27833) # (see https://github.com/ytdl-org/youtube-dl/issues/27833)
webpage_url = ie_result['webpage_url'] webpage_url = ie_result.get('webpage_url') # Playlists maynot have webpage_url
if webpage_url in self._playlist_urls: if webpage_url and webpage_url in self._playlist_urls:
self.to_screen( self.to_screen(
'[download] Skipping already downloaded playlist: %s' '[download] Skipping already downloaded playlist: %s'
% ie_result.get('title') or ie_result.get('id')) % ie_result.get('title') or ie_result.get('id'))
@ -1742,14 +1742,17 @@ class YoutubeDL:
} }
if strict: if strict:
return info return info
if ie_result.get('webpage_url'):
info.update({
'webpage_url': ie_result['webpage_url'],
'webpage_url_basename': url_basename(ie_result['webpage_url']),
'webpage_url_domain': get_domain(ie_result['webpage_url']),
})
return { return {
**info, **info,
'playlist_index': 0, 'playlist_index': 0,
'__last_playlist_index': max(ie_result['requested_entries'] or (0, 0)), '__last_playlist_index': max(ie_result['requested_entries'] or (0, 0)),
'extractor': ie_result['extractor'], 'extractor': ie_result['extractor'],
'webpage_url': ie_result['webpage_url'],
'webpage_url_basename': url_basename(ie_result['webpage_url']),
'webpage_url_domain': get_domain(ie_result['webpage_url']),
'extractor_key': ie_result['extractor_key'], 'extractor_key': ie_result['extractor_key'],
} }

Loading…
Cancel
Save