mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 16:42:57 +01:00
[vevo] Add age_limit support
This commit is contained in:
parent
27579b9e4c
commit
6cadf8c858
@ -46,6 +46,21 @@ class VevoIE(InfoExtractor):
|
|||||||
'uploader': 'Cassadee Pope',
|
'uploader': 'Cassadee Pope',
|
||||||
'title': 'I Wish I Could Break Your Heart',
|
'title': 'I Wish I Could Break Your Heart',
|
||||||
'duration': 226.101,
|
'duration': 226.101,
|
||||||
|
'age_limit': 0,
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'note': 'Age-limited video',
|
||||||
|
'url': 'https://www.vevo.com/watch/justin-timberlake/tunnel-vision-explicit/USRV81300282',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'USRV81300282',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'age_limit': 18,
|
||||||
|
'title': 'Tunnel Vision (Explicit)',
|
||||||
|
'uploader': 'Justin Timberlake',
|
||||||
|
'upload_date': '20130704',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': 'true',
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
_SMIL_BASE_URL = 'http://smil.lvl3.vevo.com/'
|
_SMIL_BASE_URL = 'http://smil.lvl3.vevo.com/'
|
||||||
@ -119,6 +134,14 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
formats = self._formats_from_json(video_info)
|
formats = self._formats_from_json(video_info)
|
||||||
|
|
||||||
|
is_explicit = video_info.get('isExplicit')
|
||||||
|
if is_explicit is True:
|
||||||
|
age_limit = 18
|
||||||
|
elif is_explicit is False:
|
||||||
|
age_limit = 0
|
||||||
|
else:
|
||||||
|
age_limit = None
|
||||||
|
|
||||||
# Download SMIL
|
# Download SMIL
|
||||||
smil_blocks = sorted((
|
smil_blocks = sorted((
|
||||||
f for f in video_info['videoVersions']
|
f for f in video_info['videoVersions']
|
||||||
@ -155,4 +178,5 @@ def _real_extract(self, url):
|
|||||||
'upload_date': upload_date.strftime('%Y%m%d'),
|
'upload_date': upload_date.strftime('%Y%m%d'),
|
||||||
'uploader': video_info['mainArtists'][0]['artistName'],
|
'uploader': video_info['mainArtists'][0]['artistName'],
|
||||||
'duration': video_info['duration'],
|
'duration': video_info['duration'],
|
||||||
|
'age_limit': age_limit,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user