diff options
| author | Sergey M․ <dstftw@gmail.com> | 2015-10-01 22:18:59 +0600 | 
|---|---|---|
| committer | Sergey M․ <dstftw@gmail.com> | 2015-10-01 22:20:28 +0600 | 
| commit | 647eab4541d1f55dea6aa20af9b35c2726dda48a (patch) | |
| tree | 81bf060b64ea2f7a595cc3f128bbdef899baf991 | |
| parent | 1e5bcdec0264190ed2a05ee49c1f9f5b20ba3aa6 (diff) | |
[extractor/common] Extract upload date from SMIL
| -rw-r--r-- | youtube_dl/extractor/common.py | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 5684227dc..b86d06523 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -39,6 +39,7 @@ from ..utils import (      RegexNotFoundError,      sanitize_filename,      unescapeHTML, +    unified_strdate,      url_basename,      xpath_text,      xpath_with_ns, @@ -1044,6 +1045,7 @@ class InfoExtractor(object):          video_id = os.path.splitext(url_basename(smil_url))[0]          title = None          description = None +        upload_date = None          for meta in smil.findall(self._xpath_ns('./head/meta', namespace)):              name = meta.attrib.get('name')              content = meta.attrib.get('content') @@ -1053,6 +1055,8 @@ class InfoExtractor(object):                  title = content              elif not description and name in ('description', 'abstract'):                  description = content +            elif not upload_date and name == 'date': +                upload_date = unified_strdate(content)          thumbnails = [{              'id': image.get('type'), @@ -1065,6 +1069,7 @@ class InfoExtractor(object):              'id': video_id,              'title': title or video_id,              'description': description, +            'upload_date': upload_date,              'thumbnails': thumbnails,              'formats': formats,              'subtitles': subtitles, | 
