aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/turner.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-08-29 19:26:53 +0100
committerRemita Amine <remitamine@gmail.com>2016-08-29 19:26:53 +0100
commitda30a20a4d8b0ece61c271a5d0f0c6de2817ef5f (patch)
tree3f2db33bc80017ebdc3c4e20e24fdac91ad0bb03 /youtube_dl/extractor/turner.py
parent1fe48afea5f203cbcb29c0d2984b7b850df8103f (diff)
[turner,cnn] move a check for wrong timestamp to CNNIE
Diffstat (limited to 'youtube_dl/extractor/turner.py')
-rw-r--r--youtube_dl/extractor/turner.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/youtube_dl/extractor/turner.py b/youtube_dl/extractor/turner.py
index f5736bd15..64fdcc56e 100644
--- a/youtube_dl/extractor/turner.py
+++ b/youtube_dl/extractor/turner.py
@@ -17,6 +17,9 @@ from ..utils import (
class TurnerBaseIE(InfoExtractor):
+ def _extract_timestamp(self, video_data):
+ return int_or_none(xpath_attr(video_data, 'dateCreated', 'uts'))
+
def _extract_cvp_info(self, data_src, video_id, path_data={}):
video_data = self._download_xml(data_src, video_id)
video_id = video_data.attrib['id'].split('/')[-1].split('.')[0]
@@ -159,10 +162,6 @@ class TurnerBaseIE(InfoExtractor):
'height': int_or_none(image.get('height')),
} for image in video_data.findall('images/image')]
- timestamp = None
- if 'cnn.com' not in data_src:
- timestamp = int_or_none(xpath_attr(video_data, 'dateCreated', 'uts'))
-
return {
'id': video_id,
'title': title,
@@ -171,7 +170,7 @@ class TurnerBaseIE(InfoExtractor):
'thumbnails': thumbnails,
'description': xpath_text(video_data, 'description'),
'duration': parse_duration(xpath_text(video_data, 'length') or xpath_text(video_data, 'trt')),
- 'timestamp': timestamp,
+ 'timestamp': self._extract_timestamp(video_data),
'upload_date': xpath_attr(video_data, 'metas', 'version'),
'series': xpath_text(video_data, 'showTitle'),
'season_number': int_or_none(xpath_text(video_data, 'seasonNumber')),