summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/hypergryph.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:37:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:37:42 +0000
commitc7bab7c39fd51c0812f70020172766303191bc01 (patch)
tree56c05fbdd4fc47409d48ba318a4b621a7b0d299a /yt_dlp/extractor/hypergryph.py
parentInitial commit. (diff)
downloadyt-dlp-c7bab7c39fd51c0812f70020172766303191bc01.tar.xz
yt-dlp-c7bab7c39fd51c0812f70020172766303191bc01.zip
Adding upstream version 2023.03.04.upstream/2023.03.04upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/hypergryph.py')
-rw-r--r--yt_dlp/extractor/hypergryph.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/yt_dlp/extractor/hypergryph.py b/yt_dlp/extractor/hypergryph.py
new file mode 100644
index 0000000..9ca6cae
--- /dev/null
+++ b/yt_dlp/extractor/hypergryph.py
@@ -0,0 +1,32 @@
+from .common import InfoExtractor
+from ..utils import js_to_json, traverse_obj
+
+
+class MonsterSirenHypergryphMusicIE(InfoExtractor):
+ _VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://monster-siren.hypergryph.com/music/514562',
+ 'info_dict': {
+ 'id': '514562',
+ 'ext': 'wav',
+ 'artist': ['塞壬唱片-MSR'],
+ 'album': 'Flame Shadow',
+ 'title': 'Flame Shadow',
+ }
+ }]
+
+ def _real_extract(self, url):
+ audio_id = self._match_id(url)
+ webpage = self._download_webpage(url, audio_id)
+ json_data = self._search_json(
+ r'window\.g_initialProps\s*=', webpage, 'data', audio_id, transform_source=js_to_json)
+
+ return {
+ 'id': audio_id,
+ 'title': traverse_obj(json_data, ('player', 'songDetail', 'name')),
+ 'url': traverse_obj(json_data, ('player', 'songDetail', 'sourceUrl')),
+ 'ext': 'wav',
+ 'vcodec': 'none',
+ 'artist': traverse_obj(json_data, ('player', 'songDetail', 'artists')),
+ 'album': traverse_obj(json_data, ('musicPlay', 'albumDetail', 'name'))
+ }