]> git.bitcoin.ninja Git - youtube-dl/blobdiff - youtube_dl/extractor/vevo.py
Rename upload_timestamp to timestamp
[youtube-dl] / youtube_dl / extractor / vevo.py
index fa147a5757df04ca69bac2e3dc6054fe6d2a7797..8f4db59d42dc4fc8268295e6a22f3470d47be9c3 100644 (file)
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
 
 import re
 import xml.etree.ElementTree
-import datetime
 
 from .common import InfoExtractor
 from ..utils import (
@@ -34,6 +33,7 @@ class VevoIE(InfoExtractor):
             "duration": 230.12,
             "width": 1920,
             "height": 1080,
+            'timestamp': 1372057200,
         }
     }, {
         'note': 'v3 SMIL format',
@@ -47,6 +47,7 @@ class VevoIE(InfoExtractor):
             'title': 'I Wish I Could Break Your Heart',
             'duration': 226.101,
             'age_limit': 0,
+            'timestamp': 1392796919,
         }
     }, {
         'note': 'Age-limited video',
@@ -58,6 +59,7 @@ class VevoIE(InfoExtractor):
             'title': 'Tunnel Vision (Explicit)',
             'uploader': 'Justin Timberlake',
             'upload_date': '20130704',
+            'timestamp': 1372906800,
         },
         'params': {
             'skip_download': 'true',
@@ -169,13 +171,13 @@ class VevoIE(InfoExtractor):
 
         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,