1 from .common
import InfoExtractor
9 class RDSIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?rds\.ca/vid(?:[eé]|%C3%A9)os/(?:[^/]+/)*(?P<id>[^/]+)-\d+\.\d+'
15 # has two 9c9media ContentPackages, the web player selects the first ContentPackage
16 'url': 'https://www.rds.ca/videos/Hockey/NationalHockeyLeague/teams/9/forum-du-5-a-7-jesperi-kotkaniemi-de-retour-de-finlande-3.1377606',
19 'display_id': 'forum-du-5-a-7-jesperi-kotkaniemi-de-retour-de-finlande',
21 'title': 'Forum du 5 à 7 : Kotkaniemi de retour de Finlande',
22 'description': 'md5:83fa38ecc4a79b19e433433254077f25',
23 'timestamp': 1606129030,
24 'upload_date': '20201123',
28 'url': 'http://www.rds.ca/vid%C3%A9os/un-voyage-positif-3.877934',
29 'only_matching': True,
32 def _real_extract(self
, url
):
33 display_id
= self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, display_id
)
37 item
= self
._parse
_json
(self
._search
_regex
(r
'(?s)itemToPush\s*=\s*({.+?});', webpage
, 'item'), display_id
, js_to_json
)
38 video_id
= str(item
['id'])
39 title
= item
.get('title') or self
._og
_search
_title
(webpage
) or self
._html
_search
_meta
(
40 'title', webpage
, 'title', fatal
=True)
41 description
= self
._og
_search
_description
(webpage
) or self
._html
_search
_meta
(
42 'description', webpage
, 'description')
43 thumbnail
= item
.get('urlImageBig') or self
._og
_search
_thumbnail
(webpage
) or self
._search
_regex
(
44 [r
'<link[^>]+itemprop="thumbnailUrl"[^>]+href="([^"]+)"',
45 r
'<span[^>]+itemprop="thumbnailUrl"[^>]+content="([^"]+)"'],
46 webpage
, 'thumbnail', fatal
=False)
47 timestamp
= parse_iso8601(self
._search
_regex
(
48 r
'<span[^>]+itemprop="uploadDate"[^>]+content="([^"]+)"',
49 webpage
, 'upload date', fatal
=False))
50 duration
= parse_duration(self
._search
_regex
(
51 r
'<span[^>]+itemprop="duration"[^>]+content="([^"]+)"',
52 webpage
, 'duration', fatal
=False))
53 age_limit
= self
._family
_friendly
_search
(webpage
)
56 '_type': 'url_transparent',
58 'display_id': display_id
,
59 'url': f
'9c9media:rds_web:{video_id}',
61 'description': description
,
62 'thumbnail': thumbnail
,
63 'timestamp': timestamp
,
65 'age_limit': age_limit
,
66 'ie_key': 'NineCNineMedia',