1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-22 09:15:47 +08:00

[jwplatform] Extract height from label

This commit is contained in:
Sergey M․ 2016-09-08 22:52:39 +07:00
parent 6cfcb8ac36
commit 37720844f6
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -63,10 +63,17 @@ class JWPlatformBaseIE(InfoExtractor):
'ext': ext,
})
else:
height = int_or_none(source.get('height'))
if height is None:
# Often no height is provided but there is a label in
# format like 1080p.
height = int_or_none(self._search_regex(
r'^(\d{3,})[pP]$', source.get('label') or '',
'height', default=None))
a_format = {
'url': source_url,
'width': int_or_none(source.get('width')),
'height': int_or_none(source.get('height')),
'height': height,
'ext': ext,
}
if source_url.startswith('rtmp'):