diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-04-16 00:56:53 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-04-16 00:57:36 +0700 |
commit | 0563f7ac6ed49929e1b488d92439928271c403df (patch) | |
tree | 577f6e26e603f045cb276295635ed75846ac380a | |
parent | 413c1f8e2fc9ef8a9fae2767ef79905510e8c37f (diff) |
[YoutubeDL] Propagate overridden metadata to IE results of type url (closes #11163)
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 7953670a7..3da5200d7 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -851,7 +851,14 @@ class YoutubeDL(object): new_result = info.copy() new_result.update(force_properties) - 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) |