浏览代码

[ntv] Move app guess outside formats loop

Sergey M․ 11 年之前
父节点
当前提交
8f6562448c
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      youtube_dl/extractor/ntv.py

+ 2 - 1
youtube_dl/extractor/ntv.py

@@ -125,13 +125,14 @@ class NTVIE(InfoExtractor):
             '7': 'video2',
             '7': 'video2',
         }
         }
 
 
+        app = apps[puid22] if puid22 in apps else apps['4']
+
         formats = []
         formats = []
         for format_id in ['', 'hi', 'webm']:
         for format_id in ['', 'hi', 'webm']:
             file = video.find('./%sfile' % format_id)
             file = video.find('./%sfile' % format_id)
             if file is None:
             if file is None:
                 continue
                 continue
             size = video.find('./%ssize' % format_id)
             size = video.find('./%ssize' % format_id)
-            app = apps[puid22] if puid22 in apps else apps['4']
             formats.append({
             formats.append({
                 'url': 'rtmp://media.ntv.ru/%s' % app,
                 'url': 'rtmp://media.ntv.ru/%s' % app,
                 'app': app,
                 'app': app,