瀏覽代碼

[youtube] Simplify url_encoded_fmt_stream_map check

Sergey M․ 10 年之前
父節點
當前提交
e40bd5f06b
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      youtube_dl/extractor/youtube.py

+ 1 - 2
youtube_dl/extractor/youtube.py

@@ -871,8 +871,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 args = ytplayer_config['args']
                 # Convert to the same format returned by compat_parse_qs
                 video_info = dict((k, [v]) for k, v in args.items())
-                if ('url_encoded_fmt_stream_map' not in args or
-                        args['url_encoded_fmt_stream_map'] == ''):
+                if not args.get('url_encoded_fmt_stream_map'):
                     raise ValueError('No stream_map present')  # caught below
             except ValueError:
                 # We fallback to the get_video_info pages (used by the embed page)