[YoutubeDL] Propagate overridden metadata to IE results of type url (closes #11163)

Sergey M․ 2017-04-16 00:56:53 +07:00
parent 413c1f8e2f
commit 0563f7ac6e
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 8 additions and 1 deletions

View File

@ -851,7 +851,14 @@ class YoutubeDL(object):
new_result = info.copy()
assert new_result.get('_type') != 'url_transparent'
# Extracted info may not be a video result (i.e.
# info.get('_type', 'video') != video) but rather an url or
# url_transparent. In such cases outer metadata (from ie_result)
# should be propagated to inner one (info). For this to happen
# _type of info should be overridden with url_transparent. This
# fixes issue from https://github.com/rg3/youtube-dl/pull/11163.
if new_result.get('_type') == 'url':
new_result['_type'] = 'url_transparent'
return self.process_ie_result(
new_result, download=download, extra_info=extra_info)