[torrins] fixed formats handling

This commit is contained in:
Aniruddh Joshi 2018-03-26 22:28:05 +05:30
parent 995cb53e40
commit 550c83f627

View File

@ -101,26 +101,31 @@ class TorrinsIE(InfoExtractor):
title = video_json.get('title') or self._og_search_title(webpage) title = video_json.get('title') or self._og_search_title(webpage)
video_id = video_json['id'] video_id = video_json['id']
formats = [ formats = []
{
if 'low' in video_json:
formats.append({
'url': video_json['low'], 'url': video_json['low'],
'format_id': 'low', 'format_id': 'low',
'height': 240, 'height': 240,
'ext': 'mp4' 'ext': 'mp4'
}, })
{
if 'medium' in video_json:
formats.append({
'url': video_json['medium'], 'url': video_json['medium'],
'format_id': 'medium', 'format_id': 'medium',
'height': 360, 'height': 360,
'ext': 'mp4' 'ext': 'mp4'
}, })
{
if 'high' in video_json:
formats.append({
'url': video_json['high'], 'url': video_json['high'],
'format_id': 'high', 'format_id': 'high',
'height': 480, 'height': 480,
'ext': 'mp4' 'ext': 'mp4'
} })
]
return { return {
'id': video_id, 'id': video_id,