Rename upload_timestamp to timestamp

pull/8/head
Philipp Hagemeister 11 years ago
parent e5de3f6c89
commit 955c451456

@ -166,7 +166,7 @@ def generator(test_case):
# If checkable fields are missing from the test case, print the info_dict # If checkable fields are missing from the test case, print the info_dict
test_info_dict = dict((key, value if not isinstance(value, compat_str) or len(value) < 250 else 'md5:' + md5(value)) test_info_dict = dict((key, value if not isinstance(value, compat_str) or len(value) < 250 else 'md5:' + md5(value))
for key, value in info_dict.items() for key, value in info_dict.items()
if value and key in ('title', 'description', 'uploader', 'upload_date', 'uploader_id', 'location')) if value and key in ('title', 'description', 'uploader', 'upload_date', 'timestamp', 'uploader_id', 'location'))
if not all(key in tc.get('info_dict', {}).keys() for key in test_info_dict.keys()): if not all(key in tc.get('info_dict', {}).keys() for key in test_info_dict.keys()):
sys.stderr.write(u'\n"info_dict": ' + json.dumps(test_info_dict, ensure_ascii=False, indent=4) + u'\n') sys.stderr.write(u'\n"info_dict": ' + json.dumps(test_info_dict, ensure_ascii=False, indent=4) + u'\n')
finally: finally:

@ -689,9 +689,9 @@ class YoutubeDL(object):
if 'display_id' not in info_dict and 'id' in info_dict: if 'display_id' not in info_dict and 'id' in info_dict:
info_dict['display_id'] = info_dict['id'] info_dict['display_id'] = info_dict['id']
if info_dict.get('upload_date') is None and info_dict.get('upload_timestamp') is not None: if info_dict.get('upload_date') is None and info_dict.get('timestamp') is not None:
upload_date = datetime.datetime.utcfromtimestamp( upload_date = datetime.datetime.utcfromtimestamp(
info_dict['upload_timestamp']) info_dict['timestamp'])
info_dict['upload_date'] = upload_date.strftime('%Y%m%d') info_dict['upload_date'] = upload_date.strftime('%Y%m%d')
# This extractors handle format selection themselves # This extractors handle format selection themselves

@ -97,9 +97,9 @@ class InfoExtractor(object):
thumbnail: Full URL to a video thumbnail image. thumbnail: Full URL to a video thumbnail image.
description: One-line video description. description: One-line video description.
uploader: Full name of the video uploader. uploader: Full name of the video uploader.
upload_timestamp:UNIX timestamp of the upload moment. timestamp: UNIX timestamp of the moment the video became available.
upload_date: Video upload date (YYYYMMDD). upload_date: Video upload date (YYYYMMDD).
If not explicitly set, calculated from update_timestamp. If not explicitly set, calculated from timestamp.
uploader_id: Nickname or id of the video uploader. uploader_id: Nickname or id of the video uploader.
location: Physical location of the video. location: Physical location of the video.
subtitles: The subtitle file contents as a dictionary in the format subtitles: The subtitle file contents as a dictionary in the format

@ -33,6 +33,7 @@ class VevoIE(InfoExtractor):
"duration": 230.12, "duration": 230.12,
"width": 1920, "width": 1920,
"height": 1080, "height": 1080,
'timestamp': 1372057200,
} }
}, { }, {
'note': 'v3 SMIL format', 'note': 'v3 SMIL format',
@ -46,6 +47,7 @@ class VevoIE(InfoExtractor):
'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, 'age_limit': 0,
'timestamp': 1392796919,
} }
}, { }, {
'note': 'Age-limited video', 'note': 'Age-limited video',
@ -57,7 +59,7 @@ class VevoIE(InfoExtractor):
'title': 'Tunnel Vision (Explicit)', 'title': 'Tunnel Vision (Explicit)',
'uploader': 'Justin Timberlake', 'uploader': 'Justin Timberlake',
'upload_date': '20130704', 'upload_date': '20130704',
'upload_timestamp': 1372906800, 'timestamp': 1372906800,
}, },
'params': { 'params': {
'skip_download': 'true', 'skip_download': 'true',
@ -175,7 +177,7 @@ class VevoIE(InfoExtractor):
'title': video_info['title'], 'title': video_info['title'],
'formats': formats, 'formats': formats,
'thumbnail': video_info['imageUrl'], 'thumbnail': video_info['imageUrl'],
'upload_timestamp': timestamp_ms // 1000, 'timestamp': timestamp_ms // 1000,
'uploader': video_info['mainArtists'][0]['artistName'], 'uploader': video_info['mainArtists'][0]['artistName'],
'duration': video_info['duration'], 'duration': video_info['duration'],
'age_limit': age_limit, 'age_limit': age_limit,

Loading…
Cancel
Save