aboutsummaryrefslogtreecommitdiffhomepage
path: root/youtube_dl/extractor/vevo.py
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2016-05-02 03:36:40 +0600
committerSergey M․ <[email protected]>2016-05-02 03:36:40 +0600
commit9508738f9a9d6fd3de2e60cd7ccb4c8631bea6f4 (patch)
treecc854c2c993b7bfe5b16f20757835f65129c0181 /youtube_dl/extractor/vevo.py
parent78a3ff33ab686bc6fc75735e2b2a5935b80311be (diff)
downloadyoutube-dl-9508738f9a9d6fd3de2e60cd7ccb4c8631bea6f4.tar.gz
youtube-dl-9508738f9a9d6fd3de2e60cd7ccb4c8631bea6f4.zip
[vevo] Extract featured artist
Diffstat (limited to 'youtube_dl/extractor/vevo.py')
-rw-r--r--youtube_dl/extractor/vevo.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/extractor/vevo.py b/youtube_dl/extractor/vevo.py
index bbe29fc51..63eab4148 100644
--- a/youtube_dl/extractor/vevo.py
+++ b/youtube_dl/extractor/vevo.py
@@ -201,6 +201,8 @@ class VevoIE(VevoBaseIE):
json_url, video_id, 'Downloading video info', 'Unable to download info')
video_info = response.get('video') or {}
video_versions = video_info.get('videoVersions')
+ artist = None
+ featured_artist = None
uploader = None
view_count = None
timestamp = None
@@ -239,7 +241,7 @@ class VevoIE(VevoBaseIE):
timestamp = parse_iso8601(video_info.get('releaseDate'))
artists = video_info.get('artists')
if artists:
- uploader = artists[0]['name']
+ artist = uploader = artists[0]['name']
view_count = int_or_none(video_info.get('views', {}).get('total'))
for video_version in video_versions:
@@ -292,7 +294,11 @@ class VevoIE(VevoBaseIE):
scale=1000)
artists = video_info.get('mainArtists')
if artists:
- uploader = artists[0]['artistName']
+ artist = uploader = artists[0]['artistName']
+
+ featured_artists = video_info.get('featuredArtists')
+ if featured_artists:
+ featured_artist = featured_artists[0]['artistName']
smil_parsed = False
for video_version in video_info['videoVersions']:
@@ -330,7 +336,9 @@ class VevoIE(VevoBaseIE):
self._sort_formats(formats)
track = video_info['title']
- title = '%s - %s' % (uploader, track) if uploader else track
+ if featured_artist:
+ artist = '%s ft. %s' % (artist, featured_artist)
+ title = '%s - %s' % (artist, track) if artist else track
genre = video_info.get('genres', [None])[0]
is_explicit = video_info.get('isExplicit')