1 from .turner
import TurnerBaseIE
8 class TruTVIE(TurnerBaseIE
):
9 _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+))'
11 'url': 'https://www.trutv.com/shows/the-carbonaro-effect/videos/sunlight-activated-flower.html',
13 'id': 'f16c03beec1e84cd7d1a51f11d8fcc29124cc7f1',
15 'title': 'Sunlight-Activated Flower',
16 'description': "A customer is stunned when he sees Michael's sunlight-activated flower.",
20 'skip_download': True,
24 def _real_extract(self
, url
):
25 series_slug
, clip_slug
, video_id
= self
._match
_valid
_url
(url
).groups()
32 display_id
= clip_slug
34 data
= self
._download
_json
(
35 f
'https://api.trutv.com/v2/web/{path}/{series_slug}/{display_id}',
37 video_data
= data
['episode'] if video_id
else data
['info']
38 media_id
= video_data
['mediaId']
39 title
= video_data
['title'].strip()
41 info
= self
._extract
_ngtv
_info
(
45 'auth_required': video_data
.get('isAuthRequired'),
49 for image
in video_data
.get('images', []):
50 image_url
= image
.get('srcUrl')
55 'width': int_or_none(image
.get('width')),
56 'height': int_or_none(image
.get('height')),
61 'display_id': display_id
,
63 'description': video_data
.get('description'),
64 'thumbnails': thumbnails
,
65 'timestamp': parse_iso8601(video_data
.get('publicationDate')),
66 'series': video_data
.get('showTitle'),
67 'season_number': int_or_none(video_data
.get('seasonNum')),
68 'episode_number': int_or_none(video_data
.get('episodeNum')),