projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6cfcb8a
)
[jwplatform] Extract height from label
author
Sergey M․
<dstftw@gmail.com>
Thu, 8 Sep 2016 15:52:39 +0000
(22:52 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 8 Sep 2016 15:53:20 +0000
(22:53 +0700)
youtube_dl/extractor/jwplatform.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/jwplatform.py
b/youtube_dl/extractor/jwplatform.py
index ce3126943939063bc65c4c710e10ea61153ac036..7aaa6547698d176104e2f3a0393504db9034ee19 100644
(file)
--- a/
youtube_dl/extractor/jwplatform.py
+++ b/
youtube_dl/extractor/jwplatform.py
@@
-63,10
+63,17
@@
class JWPlatformBaseIE(InfoExtractor):
'ext': ext,
})
else:
'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')),
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'):
'ext': ext,
}
if source_url.startswith('rtmp'):