[torrins] removed code duplication

This commit is contained in:
Aniruddh Joshi 2018-03-26 23:17:27 +05:30
parent 550c83f627
commit 83ab02db3e

View file

@ -103,29 +103,14 @@ class TorrinsIE(InfoExtractor):
formats = [] formats = []
if 'low' in video_json: for format, height in {'low': 240, 'medium': 360, 'high': 480}.items():
formats.append({ if format in video_json:
'url': video_json['low'], formats.append({
'format_id': 'low', 'url': video_json['low'],
'height': 240, 'format_id': format,
'ext': 'mp4' 'height': height,
}) 'ext': 'mp4'
})
if 'medium' in video_json:
formats.append({
'url': video_json['medium'],
'format_id': 'medium',
'height': 360,
'ext': 'mp4'
})
if 'high' in video_json:
formats.append({
'url': video_json['high'],
'format_id': 'high',
'height': 480,
'ext': 'mp4'
})
return { return {
'id': video_id, 'id': video_id,