浏览代码

[extractor/common] Extract height from res attribute of source tag for HTML5 videos (closes #14034)

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

+ 3 - 0
youtube_dl/extractor/common.py

@@ -2184,6 +2184,9 @@ class InfoExtractor(object):
                     f = parse_content_type(source_attributes.get('type'))
                     is_plain_url, formats = _media_formats(src, media_type, f)
                     if is_plain_url:
+                        # res attribute is not standard but seen several times
+                        # in the wild
+                        f['height'] = int_or_none(source_attributes.get('res'))
                         f.update(formats[0])
                         media_info['formats'].append(f)
                     else: