mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 10:24:33 +01:00
[reverbnation] Eliminate code duplication in thumbnails extraction
This commit is contained in:
parent
3adb9d119e
commit
f68901e50a
@ -1,7 +1,10 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import str_or_none
|
||||
from ..utils import (
|
||||
qualities,
|
||||
str_or_none,
|
||||
)
|
||||
|
||||
|
||||
class ReverbNationIE(InfoExtractor):
|
||||
@ -28,15 +31,14 @@ class ReverbNationIE(InfoExtractor):
|
||||
note='Downloading information of song %s' % song_id
|
||||
)
|
||||
|
||||
THUMBNAILS = ('thumbnail', 'image')
|
||||
quality = qualities(THUMBNAILS)
|
||||
thumbnails = []
|
||||
if api_res.get('image'):
|
||||
for thumb_key in THUMBNAILS:
|
||||
if api_res.get(thumb_key):
|
||||
thumbnails.append({
|
||||
'url': api_res.get('image'),
|
||||
})
|
||||
if api_res.get('thumbnail'):
|
||||
thumbnails.append({
|
||||
'url': api_res.get('thumbnail'),
|
||||
'preference': -2,
|
||||
'url': api_res[thumb_key],
|
||||
'preference': quality(thumb_key)
|
||||
})
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user