projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1e5bcde
)
[extractor/common] Extract upload date from SMIL
author
Sergey M․
<dstftw@gmail.com>
Thu, 1 Oct 2015 16:18:59 +0000
(22:18 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 1 Oct 2015 16:20:28 +0000
(22:20 +0600)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 5684227dcfca770be68d1feea28616a5e0d84e57..b86d0652338457a65c4fc655d5e0406aa42850b0 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
youtube_dl/extractor/common.py
@@
-39,6
+39,7
@@
from ..utils import (
RegexNotFoundError,
sanitize_filename,
unescapeHTML,
RegexNotFoundError,
sanitize_filename,
unescapeHTML,
+ unified_strdate,
url_basename,
xpath_text,
xpath_with_ns,
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
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')
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
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'),
thumbnails = [{
'id': image.get('type'),
@@
-1065,6
+1069,7
@@
class InfoExtractor(object):
'id': video_id,
'title': title or video_id,
'description': description,
'id': video_id,
'title': title or video_id,
'description': description,
+ 'upload_date': upload_date,
'thumbnails': thumbnails,
'formats': formats,
'subtitles': subtitles,
'thumbnails': thumbnails,
'formats': formats,
'subtitles': subtitles,