瀏覽代碼

Remove video_result helper method

Calling it was more complex then actually including the type in the video info
Philipp Hagemeister 12 年之前
父節點
當前提交
690e872c51
共有 3 個文件被更改,包括 4 次插入7 次删除
  1. 2 1
      youtube_dl/extractor/archiveorg.py
  2. 0 5
      youtube_dl/extractor/common.py
  3. 2 1
      youtube_dl/extractor/dreisat.py

+ 2 - 1
youtube_dl/extractor/archiveorg.py

@@ -48,6 +48,7 @@ class ArchiveOrgIE(InfoExtractor):
         formats.sort(key=lambda fdata: fdata['file_size'])
 
         info = {
+            '_type': 'video',
             'id': video_id,
             'title': title,
             'formats': formats,
@@ -63,4 +64,4 @@ class ArchiveOrgIE(InfoExtractor):
         info['url'] = formats[-1]['url']
         info['ext'] = determine_ext(formats[-1]['url'])
 
-        return self.video_result(info)
+        return info

+ 0 - 5
youtube_dl/extractor/common.py

@@ -169,11 +169,6 @@ class InfoExtractor(object):
         self.to_screen(u'Logging in')
 
     #Methods for following #608
-    #They set the correct value of the '_type' key
-    def video_result(self, video_info):
-        """Returns a video"""
-        video_info['_type'] = 'video'
-        return video_info
     def url_result(self, url, ie=None):
         """Returns a url that points to a page that should be processed"""
         #TODO: ie should be the class used for getting the info

+ 2 - 1
youtube_dl/extractor/dreisat.py

@@ -67,6 +67,7 @@ class DreiSatIE(InfoExtractor):
         formats.sort(key=_sortkey)
 
         info = {
+            '_type': 'video',
             'id': video_id,
             'title': video_title,
             'formats': formats,
@@ -81,4 +82,4 @@ class DreiSatIE(InfoExtractor):
         info['url'] = formats[-1]['url']
         info['ext'] = determine_ext(formats[-1]['url'])
 
-        return self.video_result(info)
+        return info