diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-03-13 15:30:25 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-03-13 15:30:25 +0100 |
commit | 9d2ecdbc712d4e500dd0207041392b143082ad00 (patch) | |
tree | 6dbd0bcf850d94ee622aeb53507f7ffbea55f0df /youtube_dl/YoutubeDL.py | |
parent | 9b69af5342818bf78c44cf205dc036a84c128e8c (diff) |
[vevo] Centralize timestamp handling
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 63ed08abf..d9f83419e 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -4,6 +4,7 @@ from __future__ import absolute_import, unicode_literals import collections +import datetime import errno import io import json @@ -688,6 +689,11 @@ class YoutubeDL(object): if 'display_id' not in info_dict and 'id' in info_dict: info_dict['display_id'] = info_dict['id'] + if info_dict.get('upload_date') is None and info_dict.get('upload_timestamp') is not None: + upload_date = datetime.datetime.utcfromtimestamp( + info_dict['upload_timestamp']) + info_dict['upload_date'] = upload_date.strftime('%Y%m%d') + # This extractors handle format selection themselves if info_dict['extractor'] in ['Youku']: if download: |