]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
Set the 'extractor_key' field in the info_dict
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 3 Nov 2013 11:14:44 +0000 (12:14 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 3 Nov 2013 11:14:44 +0000 (12:14 +0100)
It's the string returned by the class method 'ie_key', which allows to retrieve the extractor with 'get_info_extractor'

test/test_download.py
youtube_dl/YoutubeDL.py

index d6cc9ec3306c66bfb5e7ba76bb2d373138ab8632..73379beb1921b32e7f2b43b9865d85d71a618fc5 100644 (file)
@@ -149,7 +149,7 @@ def generator(test_case):
                 for key in ('id', 'url', 'title', 'ext'):
                     self.assertTrue(key in info_dict.keys() and info_dict[key])
                 # Check for mandatory fields that are automatically set by YoutubeDL
-                for key in ['webpage_url', 'extractor']:
+                for key in ['webpage_url', 'extractor', 'extractor_key']:
                     self.assertTrue(info_dict.get(key), u'Missing field: %s' % key)
         finally:
             try_rm_tcs_files()
index 8938a2cd30f566c2c9d86e93da5ce6483ef44f0e..86a6fd043ea0b1e0cb65764d18a28a71d19bb6da 100644 (file)
@@ -357,7 +357,8 @@ class YoutubeDL(object):
                 self.add_extra_info(ie_result,
                     {
                         'extractor': ie.IE_NAME,
-                        'webpage_url': url
+                        'webpage_url': url,
+                        'extractor_key': ie.ie_key(),
                     })
                 return self.process_ie_result(ie_result, download, extra_info)
             except ExtractorError as de: # An error we somewhat expected
@@ -421,6 +422,7 @@ class YoutubeDL(object):
                     'playlist_index': i + playliststart,
                     'extractor': ie_result['extractor'],
                     'webpage_url': ie_result['webpage_url'],
+                    'extractor_key': ie_result['extractor_key'],
                 }
                 entry_result = self.process_ie_result(entry,
                                                       download=download,
@@ -434,6 +436,7 @@ class YoutubeDL(object):
                     {
                         'extractor': ie_result['extractor'],
                         'webpage_url': ie_result['webpage_url'],
+                        'extractor_key': ie_result['extractor_key'],
                     })
                 return r
             ie_result['entries'] = [