aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/viewster.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-09-22 21:47:56 +0600
committerSergey M․ <dstftw@gmail.com>2015-09-22 21:47:56 +0600
commit8e97596b7b62fb35ccfeb37c0ce5cb008b217d99 (patch)
treebfd34cd67a8b87afeb618ccad87513124f0fc776 /youtube_dl/extractor/viewster.py
parent92085e7099d3607ff512f241454d6f6f4535b05a (diff)
[viewster] Extract height from bitrate and prefer mp4 videos
Diffstat (limited to 'youtube_dl/extractor/viewster.py')
-rw-r--r--youtube_dl/extractor/viewster.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/youtube_dl/extractor/viewster.py b/youtube_dl/extractor/viewster.py
index c68a38167..c6aa73c0e 100644
--- a/youtube_dl/extractor/viewster.py
+++ b/youtube_dl/extractor/viewster.py
@@ -120,11 +120,18 @@ class ViewsterIE(InfoExtractor):
fatal=False # m3u8 sometimes fail
))
else:
- formats.append({
+ format_id = media.get('Bitrate')
+ f = {
'url': video_url,
+ 'format_id': 'mp4-%s' % format_id,
'height': int_or_none(media.get('Height')),
'width': int_or_none(media.get('Width')),
- })
+ 'preference': 1,
+ }
+ if format_id and not f['height']:
+ f['height'] = int_or_none(self._search_regex(
+ r'^(\d+)[pP]$', format_id, 'height', default=None))
+ formats.append(f)
self._sort_formats(formats)
synopsis = info.get('Synopsis', {})