import re
import xml.etree.ElementTree
-import datetime
from .common import InfoExtractor
from ..utils import (
"duration": 230.12,
"width": 1920,
"height": 1080,
+ 'timestamp': 1372057200,
}
}, {
'note': 'v3 SMIL format',
'uploader': 'Cassadee Pope',
'title': 'I Wish I Could Break Your Heart',
'duration': 226.101,
+ 'age_limit': 0,
+ 'timestamp': 1392796919,
+ }
+ }, {
+ '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',
+ 'timestamp': 1372906800,
+ },
+ 'params': {
+ 'skip_download': 'true',
}
}]
_SMIL_BASE_URL = 'http://smil.lvl3.vevo.com/'
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
smil_blocks = sorted((
f for f in video_info['videoVersions']
timestamp_ms = int(self._search_regex(
r'/Date\((\d+)\)/', video_info['launchDate'], 'launch date'))
- upload_date = datetime.datetime.fromtimestamp(timestamp_ms // 1000)
+
return {
'id': video_id,
'title': video_info['title'],
'formats': formats,
'thumbnail': video_info['imageUrl'],
- 'upload_date': upload_date.strftime('%Y%m%d'),
+ 'timestamp': timestamp_ms // 1000,
'uploader': video_info['mainArtists'][0]['artistName'],
'duration': video_info['duration'],
+ 'age_limit': age_limit,
}