1 from .common
import InfoExtractor
2 from ..utils
import int_or_none
, traverse_obj
5 class PremiershipRugbyIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:\w+\.)premiershiprugby\.(?:com)/watch/(?P<id>[\w-]+)'
8 'url': 'https://www.premiershiprugby.com/watch/full-match-harlequins-v-newcastle-falcons',
11 'title': 'Full Match: Harlequins v Newcastle Falcons',
13 'thumbnail': 'https://open.http.mp.streamamg.com/p/3000914/sp/300091400/thumbnail/entry_id/0_mbkb7ldt//width/960/height/540/type/1/quality/75',
16 'categories': ['Full Match', 'Harlequins', 'Newcastle Falcons', 'gallaher premiership'],
20 def _real_extract(self
, url
):
21 display_id
= self
._match
_id
(url
)
22 json_data
= self
._download
_json
(
23 f
'https://article-cms-api.incrowdsports.com/v2/articles/slug/{display_id}',
24 display_id
, query
={'clientId': 'PRL'})['data']['article']
26 formats
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(
27 json_data
['heroMedia']['content']['videoLink'], display_id
)
30 'id': json_data
['heroMedia']['content']['sourceSystemId'],
31 'display_id': display_id
,
32 'title': traverse_obj(json_data
, ('heroMedia', 'title')),
35 'thumbnail': traverse_obj(json_data
, ('heroMedia', 'content', 'videoThumbnail')),
36 'duration': int_or_none(traverse_obj(json_data
, ('heroMedia', 'content', 'metadata', 'msDuration')), scale
=1000),
37 'tags': json_data
.get('tags'),
38 'categories': traverse_obj(json_data
, ('categories', ..., 'text')),