1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-06-02 10:29:28 +00:00

[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 = []
if 'low' in video_json:
formats.append({
'url': video_json['low'],
'format_id': 'low',
'height': 240,
'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'
})
for format, height in {'low': 240, 'medium': 360, 'high': 480}.items():
if format in video_json:
formats.append({
'url': video_json['low'],
'format_id': format,
'height': height,
'ext': 'mp4'
})
return {
'id': video_id,