]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/cozytv.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import unified_strdate
8 class CozyTVIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?cozy\.tv/(?P<uploader>[^/]+)/replays/(?P<id>[^/$#&?]+)'
12 'url': 'https://cozy.tv/beardson/replays/2021-11-19_1',
14 'id': 'beardson-2021-11-19_1',
16 'title': 'pokemon pt2',
17 'uploader': 'beardson',
18 'upload_date': '20211119',
22 'params': {'skip_download': True}
25 def _real_extract(self
, url
):
26 uploader
, date
= self
._match
_valid
_url
(url
).groups()
27 id = f
'{uploader}-{date}'
28 data_json
= self
._download
_json
(f
'https://api.cozy.tv/cache/{uploader}/replay/{date}', id)
29 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(
30 f
'https://cozycdn.foxtrotstream.xyz/replays/{uploader}/{date}/index.m3u8', id, ext
='mp4')
33 'title': data_json
.get('title'),
34 'uploader': data_json
.get('user') or uploader
,
35 'upload_date': unified_strdate(data_json
.get('date')),
37 'duration': data_json
.get('duration'),
39 'subtitles': subtitles
,