mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-15 15:52:38 +00:00
Fix --flat-playlist
when entry has no ie_key
This commit is contained in:
parent
bd4d1ea398
commit
6033d9808d
1 changed files with 14 additions and 9 deletions
|
@ -104,6 +104,7 @@ from .utils import (
|
||||||
ThrottledDownload,
|
ThrottledDownload,
|
||||||
to_high_limit_path,
|
to_high_limit_path,
|
||||||
traverse_obj,
|
traverse_obj,
|
||||||
|
try_get,
|
||||||
UnavailableVideoError,
|
UnavailableVideoError,
|
||||||
url_basename,
|
url_basename,
|
||||||
version_tuple,
|
version_tuple,
|
||||||
|
@ -1176,11 +1177,15 @@ class YoutubeDL(object):
|
||||||
return ie_result
|
return ie_result
|
||||||
|
|
||||||
def add_default_extra_info(self, ie_result, ie, url):
|
def add_default_extra_info(self, ie_result, ie, url):
|
||||||
|
if url is not None:
|
||||||
self.add_extra_info(ie_result, {
|
self.add_extra_info(ie_result, {
|
||||||
'extractor': ie.IE_NAME,
|
|
||||||
'webpage_url': url,
|
'webpage_url': url,
|
||||||
'original_url': url,
|
'original_url': url,
|
||||||
'webpage_url_basename': url_basename(url),
|
'webpage_url_basename': url_basename(url),
|
||||||
|
})
|
||||||
|
if ie is not None:
|
||||||
|
self.add_extra_info(ie_result, {
|
||||||
|
'extractor': ie.IE_NAME,
|
||||||
'extractor_key': ie.ie_key(),
|
'extractor_key': ie.ie_key(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1201,8 +1206,8 @@ class YoutubeDL(object):
|
||||||
or extract_flat is True):
|
or extract_flat is True):
|
||||||
info_copy = ie_result.copy()
|
info_copy = ie_result.copy()
|
||||||
self.add_extra_info(info_copy, extra_info)
|
self.add_extra_info(info_copy, extra_info)
|
||||||
self.add_default_extra_info(
|
ie = try_get(ie_result.get('ie_key'), self.get_info_extractor)
|
||||||
info_copy, self.get_info_extractor(ie_result.get('ie_key')), ie_result['url'])
|
self.add_default_extra_info(info_copy, ie, ie_result['url'])
|
||||||
self.__forced_printings(info_copy, self.prepare_filename(info_copy), incomplete=True)
|
self.__forced_printings(info_copy, self.prepare_filename(info_copy), incomplete=True)
|
||||||
return ie_result
|
return ie_result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue