aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/turner.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-05-08 15:00:57 +0100
committerRemita Amine <remitamine@gmail.com>2017-05-08 15:07:40 +0100
commit04c09f19618345203a787c300e4ecf99f1ff9b02 (patch)
tree86f093980d2c3ab5a1758a1e67857e047c5cfc42 /youtube_dl/extractor/turner.py
parentbf82b8732353f45582cfefc6cced01721fbf4154 (diff)
[turner] extract thumbnail and is_live and strip description
Diffstat (limited to 'youtube_dl/extractor/turner.py')
-rw-r--r--youtube_dl/extractor/turner.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dl/extractor/turner.py b/youtube_dl/extractor/turner.py
index 1c0be9fc6..efeb677ee 100644
--- a/youtube_dl/extractor/turner.py
+++ b/youtube_dl/extractor/turner.py
@@ -13,6 +13,7 @@ from ..utils import (
xpath_attr,
update_url_query,
ExtractorError,
+ strip_or_none,
)
@@ -163,17 +164,21 @@ class TurnerBaseIE(AdobePassIE):
'height': int_or_none(image.get('height')),
} for image in video_data.findall('images/image')]
+ is_live = xpath_text(video_data, 'isLive') == 'true'
+
return {
'id': video_id,
- 'title': title,
+ 'title': self._live_title(title) if is_live else title,
'formats': formats,
'subtitles': subtitles,
'thumbnails': thumbnails,
- 'description': xpath_text(video_data, 'description'),
+ 'thumbnail': xpath_text(video_data, 'poster'),
+ 'description': strip_or_none(xpath_text(video_data, 'description')),
'duration': parse_duration(xpath_text(video_data, 'length') or xpath_text(video_data, 'trt')),
'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')),
'episode_number': int_or_none(xpath_text(video_data, 'episodeNumber')),
+ 'is_live': is_live,
}