未验证 提交 6033d980 编写于 作者: P pukkandan

Fix `--flat-playlist` when entry has no `ie_key`

上级 bd4d1ea3
......@@ -104,6 +104,7 @@
ThrottledDownload,
to_high_limit_path,
traverse_obj,
try_get,
UnavailableVideoError,
url_basename,
version_tuple,
......@@ -1176,13 +1177,17 @@ def __extract_info(self, url, ie, download, extra_info, process):
return ie_result
def add_default_extra_info(self, ie_result, ie, url):
self.add_extra_info(ie_result, {
'extractor': ie.IE_NAME,
'webpage_url': url,
'original_url': url,
'webpage_url_basename': url_basename(url),
'extractor_key': ie.ie_key(),
})
if url is not None:
self.add_extra_info(ie_result, {
'webpage_url': url,
'original_url': 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(),
})
def process_ie_result(self, ie_result, download=True, extra_info={}):
"""
......@@ -1201,8 +1206,8 @@ def process_ie_result(self, ie_result, download=True, extra_info={}):
or extract_flat is True):
info_copy = ie_result.copy()
self.add_extra_info(info_copy, extra_info)
self.add_default_extra_info(
info_copy, self.get_info_extractor(ie_result.get('ie_key')), ie_result['url'])
ie = try_get(ie_result.get('ie_key'), self.get_info_extractor)
self.add_default_extra_info(info_copy, ie, ie_result['url'])
self.__forced_printings(info_copy, self.prepare_filename(info_copy), incomplete=True)
return ie_result
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册