diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-03 12:11:13 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-03 12:11:13 +0100 |
commit | 9103bbc5cd11957de2e906e4401dcf4df9511d28 (patch) | |
tree | c8adf22aeb2eb553a33d9de51b673a416ff042f9 /youtube_dl/YoutubeDL.py | |
parent | b6c45014aed4b3176be1142958be98d7cb9dbaff (diff) |
Add the 'webpage_url' field to info_dict
The url for the video page, it must allow to reproduce the result.
It's automatically set by YoutubeDL if it's missing.
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index a3e0a700f..8938a2cd3 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -354,8 +354,11 @@ class YoutubeDL(object): '_type': 'compat_list', 'entries': ie_result, } - if 'extractor' not in ie_result: - ie_result['extractor'] = ie.IE_NAME + self.add_extra_info(ie_result, + { + 'extractor': ie.IE_NAME, + 'webpage_url': url + }) return self.process_ie_result(ie_result, download, extra_info) except ExtractorError as de: # An error we somewhat expected self.report_error(compat_str(de), de.format_traceback()) @@ -417,6 +420,7 @@ class YoutubeDL(object): 'playlist': playlist, 'playlist_index': i + playliststart, 'extractor': ie_result['extractor'], + 'webpage_url': ie_result['webpage_url'], } entry_result = self.process_ie_result(entry, download=download, @@ -427,7 +431,10 @@ class YoutubeDL(object): elif result_type == 'compat_list': def _fixup(r): self.add_extra_info(r, - {'extractor': ie_result['extractor']}) + { + 'extractor': ie_result['extractor'], + 'webpage_url': ie_result['webpage_url'], + }) return r ie_result['entries'] = [ self.process_ie_result(_fixup(r), download, extra_info) |