aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Gupta <39122144+Ashish0804@users.noreply.github.com>2021-10-18 08:11:31 +0530
committerGitHub <noreply@github.com>2021-10-18 08:11:31 +0530
commit920134b2e526ccb39a368add5547788361c78fb3 (patch)
treeac96417eeb3483edc12575c017d6a9f0fdc2e533
parent72ab7687194f353079b4f6e6ac9a59f586c9a9ef (diff)
downloadhypervideo-pre-920134b2e526ccb39a368add5547788361c78fb3.tar.lz
hypervideo-pre-920134b2e526ccb39a368add5547788361c78fb3.tar.xz
hypervideo-pre-920134b2e526ccb39a368add5547788361c78fb3.zip
[Gronkh] Add extractor (#1299)
Closes #1293 Authored by: Ashish0804
-rw-r--r--yt_dlp/extractor/extractors.py1
-rw-r--r--yt_dlp/extractor/gronkh.py43
2 files changed, 44 insertions, 0 deletions
diff --git a/yt_dlp/extractor/extractors.py b/yt_dlp/extractor/extractors.py
index ffd26ca0b..f4f817fcb 100644
--- a/yt_dlp/extractor/extractors.py
+++ b/yt_dlp/extractor/extractors.py
@@ -527,6 +527,7 @@ from .gopro import GoProIE
from .goshgay import GoshgayIE
from .gotostage import GoToStageIE
from .gputechconf import GPUTechConfIE
+from .gronkh import GronkhIE
from .groupon import GrouponIE
from .hbo import HBOIE
from .hearthisat import HearThisAtIE
diff --git a/yt_dlp/extractor/gronkh.py b/yt_dlp/extractor/gronkh.py
new file mode 100644
index 000000000..a7792a5e0
--- /dev/null
+++ b/yt_dlp/extractor/gronkh.py
@@ -0,0 +1,43 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import unified_strdate
+
+
+class GronkhIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?gronkh\.tv/stream/(?P<id>\d+)'
+
+ _TESTS = [{
+ 'url': 'https://gronkh.tv/stream/536',
+ 'info_dict': {
+ 'id': '536',
+ 'ext': 'mp4',
+ 'title': 'GTV0536, 2021-10-01 - MARTHA IS DEAD #FREiAB1830 !FF7 !horde !archiv',
+ 'view_count': 19491,
+ 'thumbnail': 'https://01.cdn.vod.farm/preview/6436746cce14e25f751260a692872b9b.jpg',
+ 'upload_date': '20211001'
+ },
+ 'params': {'skip_download': True}
+ }]
+
+ def _real_extract(self, url):
+ id = self._match_id(url)
+ data_json = self._download_json(f'https://api.gronkh.tv/v1/video/info?episode={id}', id)
+ m3u8_url = self._download_json(f'https://api.gronkh.tv/v1/video/playlist?episode={id}', id)['playlist_url']
+ formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, id)
+ if data_json.get('vtt_url'):
+ subtitles.setdefault('en', []).append({
+ 'url': data_json['vtt_url'],
+ 'ext': 'vtt',
+ })
+ self._sort_formats(formats)
+ return {
+ 'id': id,
+ 'title': data_json.get('title'),
+ 'view_count': data_json.get('views'),
+ 'thumbnail': data_json.get('preview_url'),
+ 'upload_date': unified_strdate(data_json.get('created_at')),
+ 'formats': formats,
+ 'subtitles': subtitles,
+ }