]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/ctv.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class CTVIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?ctv\.ca/(?P<id>(?:show|movie)s/[^/]+/[^/?#&]+)'
10 'url': 'https://www.ctv.ca/shows/your-morning/wednesday-december-23-2020-s5e88',
14 'title': 'Wednesday, December 23, 2020',
15 'thumbnail': r
're:^https?://.*\.jpg$',
16 'description': 'Your Morning delivers original perspectives and unique insights into the headlines of the day.',
17 'timestamp': 1608732000,
18 'upload_date': '20201223',
19 'series': 'Your Morning',
20 'season': '2020-2021',
23 'tags': ['Your Morning'],
24 'categories': ['Talk Show'],
28 'url': 'https://www.ctv.ca/movies/adam-sandlers-eight-crazy-nights/adam-sandlers-eight-crazy-nights',
29 'only_matching': True,
32 def _real_extract(self
, url
):
33 display_id
= self
._match
_id
(url
)
34 content
= self
._download
_json
(
35 'https://www.ctv.ca/space-graphql/graphql', display_id
, query
={
37 resolvedPath(path: "/%s") {
48 })['data']['resolvedPath']['lastSegment']['content']
49 video_id
= content
['axisId']
50 return self
.url_result(
51 '9c9media:%s:%s' % (content
['videoPlayerDestCode'], video_id
),
52 'NineCNineMedia', video_id
)