1 from .common
import InfoExtractor
2 from ..utils
import unified_strdate
5 class CozyTVIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?cozy\.tv/(?P<uploader>[^/]+)/replays/(?P<id>[^/$#&?]+)'
9 'url': 'https://cozy.tv/beardson/replays/2021-11-19_1',
11 'id': 'beardson-2021-11-19_1',
13 'title': 'pokemon pt2',
14 'uploader': 'beardson',
15 'upload_date': '20211119',
19 'params': {'skip_download': True},
22 def _real_extract(self
, url
):
23 uploader
, date
= self
._match
_valid
_url
(url
).groups()
24 video_id
= f
'{uploader}-{date}'
25 data_json
= self
._download
_json
(f
'https://api.cozy.tv/cache/{uploader}/replay/{date}', video_id
)
26 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(
27 f
'https://cozycdn.foxtrotstream.xyz/replays/{uploader}/{date}/index.m3u8', video_id
, ext
='mp4')
30 'title': data_json
.get('title'),
31 'uploader': data_json
.get('user') or uploader
,
32 'upload_date': unified_strdate(data_json
.get('date')),
34 'duration': data_json
.get('duration'),
36 'subtitles': subtitles
,