[wrzuta] Fix audio extension lookup (Closes #4156)

Also, replace deleted test case
This commit is contained in:
Naglis Jonaitis 2014-11-11 16:23:06 +02:00
parent 1d4df56d09
commit 60526d6bcb

View File

@ -27,15 +27,15 @@ class WrzutaIE(InfoExtractor):
'description': 'md5:7fb5ef3c21c5893375fda51d9b15d9cd',
},
}, {
'url': 'http://w729.wrzuta.pl/audio/9oXJqdcndqv/david_guetta_amp_showtek_ft._vassy_-_bad',
'md5': '1e546a18e1c22ac6e9adce17b8961ff5',
'url': 'http://jolka85.wrzuta.pl/audio/063jOPX5ue2/liber_natalia_szroeder_-_teraz_ty',
'md5': 'bc78077859bea7bcfe4295d7d7fc9025',
'info_dict': {
'id': '9oXJqdcndqv',
'id': '063jOPX5ue2',
'ext': 'ogg',
'title': 'David Guetta & Showtek ft. Vassy - Bad',
'duration': 270,
'uploader_id': 'w729',
'description': 'md5:4628f01c666bbaaecefa83476cfa794a',
'title': 'Liber & Natalia Szroeder - Teraz Ty',
'duration': 203,
'uploader_id': 'jolka85',
'description': 'md5:2d2b6340f9188c8c4cd891580e481096',
},
}]
@ -49,16 +49,17 @@ class WrzutaIE(InfoExtractor):
quality = qualities(['SD', 'MQ', 'HQ', 'HD'])
audio_table = {'flv': 'mp3', 'webm': 'ogg', 'mp3': 'mp3'}
audio_table = {'flv': 'mp3', 'webm': 'ogg'}
embedpage = self._download_json('http://www.wrzuta.pl/npp/embed/%s/%s' % (uploader, video_id), video_id)
formats = []
for media in embedpage['url']:
fmt = media['type'].split('@')[0]
if typ == 'audio':
ext = audio_table[media['type'].split('@')[0]]
ext = audio_table.get(fmt, fmt)
else:
ext = media['type'].split('@')[0]
ext = fmt
formats.append({
'format_id': '%s_%s' % (ext, media['quality'].lower()),