]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/gronkh.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import unified_strdate
8 class GronkhIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?gronkh\.tv/(?:watch/)?stream/(?P<id>\d+)'
12 'url': 'https://gronkh.tv/stream/536',
16 'title': 'GTV0536, 2021-10-01 - MARTHA IS DEAD #FREiAB1830 !FF7 !horde !archiv',
18 'thumbnail': 'https://01.cdn.vod.farm/preview/6436746cce14e25f751260a692872b9b.jpg',
19 'upload_date': '20211001'
21 'params': {'skip_download': True}
23 'url': 'https://gronkh.tv/watch/stream/546',
24 'only_matching': True,
27 def _real_extract(self
, url
):
28 id = self
._match
_id
(url
)
29 data_json
= self
._download
_json
(f
'https://api.gronkh.tv/v1/video/info?episode={id}', id)
30 m3u8_url
= self
._download
_json
(f
'https://api.gronkh.tv/v1/video/playlist?episode={id}', id)['playlist_url']
31 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(m3u8_url
, id)
32 if data_json
.get('vtt_url'):
33 subtitles
.setdefault('en', []).append({
34 'url': data_json
['vtt_url'],
37 self
._sort
_formats
(formats
)
40 'title': data_json
.get('title'),
41 'view_count': data_json
.get('views'),
42 'thumbnail': data_json
.get('preview_url'),
43 'upload_date': unified_strdate(data_json
.get('created_at')),
45 'subtitles': subtitles
,