1 from .common
import InfoExtractor
4 class CTVIE(InfoExtractor
):
5 _VALID_URL
= r
'https?://(?:www\.)?ctv\.ca/(?P<id>(?:show|movie)s/[^/]+/[^/?#&]+)'
7 'url': 'https://www.ctv.ca/shows/your-morning/wednesday-december-23-2020-s5e88',
11 'title': 'Wednesday, December 23, 2020',
12 'thumbnail': r
're:^https?://.*\.jpg$',
13 'description': 'Your Morning delivers original perspectives and unique insights into the headlines of the day.',
14 'timestamp': 1608732000,
15 'upload_date': '20201223',
16 'series': 'Your Morning',
17 'season': '2020-2021',
20 'tags': ['Your Morning'],
21 'categories': ['Talk Show'],
25 'url': 'https://www.ctv.ca/movies/adam-sandlers-eight-crazy-nights/adam-sandlers-eight-crazy-nights',
26 'only_matching': True,
29 def _real_extract(self
, url
):
30 display_id
= self
._match
_id
(url
)
31 content
= self
._download
_json
(
32 'https://www.ctv.ca/space-graphql/graphql', display_id
, query
={
34 resolvedPath(path: "/%s") {
44 }''' % display_id
, # noqa: UP031
45 })['data']['resolvedPath']['lastSegment']['content']
46 video_id
= content
['axisId']
47 return self
.url_result(
48 '9c9media:{}:{}'.format(content
['videoPlayerDestCode'], video_id
),
49 'NineCNineMedia', video_id
)