]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/trutv.py
2 from __future__
import unicode_literals
5 from .turner
import TurnerBaseIE
12 class TruTVIE(TurnerBaseIE
):
13 _VALID_URL
= r
'https?://(?:www\.)?trutv\.com/(?:shows|full-episodes)/(?P<series_slug>[0-9A-Za-z-]+)/(?:videos/(?P<clip_slug>[0-9A-Za-z-]+)|(?P<id>\d+))'
15 'url': 'https://www.trutv.com/shows/the-carbonaro-effect/videos/sunlight-activated-flower.html',
17 'id': 'f16c03beec1e84cd7d1a51f11d8fcc29124cc7f1',
19 'title': 'Sunlight-Activated Flower',
20 'description': "A customer is stunned when he sees Michael's sunlight-activated flower.",
24 'skip_download': True,
28 def _real_extract(self
, url
):
29 series_slug
, clip_slug
, video_id
= self
._match
_valid
_url
(url
).groups()
36 display_id
= clip_slug
38 data
= self
._download
_json
(
39 'https://api.trutv.com/v2/web/%s/%s/%s' % (path
, series_slug
, display_id
),
41 video_data
= data
['episode'] if video_id
else data
['info']
42 media_id
= video_data
['mediaId']
43 title
= video_data
['title'].strip()
45 info
= self
._extract
_ngtv
_info
(
49 'auth_required': video_data
.get('isAuthRequired'),
53 for image
in video_data
.get('images', []):
54 image_url
= image
.get('srcUrl')
59 'width': int_or_none(image
.get('width')),
60 'height': int_or_none(image
.get('height')),
65 'display_id': display_id
,
67 'description': video_data
.get('description'),
68 'thumbnails': thumbnails
,
69 'timestamp': parse_iso8601(video_data
.get('publicationDate')),
70 'series': video_data
.get('showTitle'),
71 'season_number': int_or_none(video_data
.get('seasonNum')),
72 'episode_number': int_or_none(video_data
.get('episodeNum')),