aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/extractor/bitwave.py
diff options
context:
space:
mode:
authorTom-Oliver Heidel <github@tom-oliver.eu>2020-11-30 02:51:41 +0100
committerGitHub <noreply@github.com>2020-11-30 02:51:41 +0100
commitb662fc8d2033c615ffbdd3b51123b446c03255e8 (patch)
tree3d32dc25a663f4e61fc28860acda67c7a425cb7a /youtube_dlc/extractor/bitwave.py
parent8924ddc3eec4c03c6776673d0d5e823dc5445549 (diff)
parent929576bb9e4aa31f0516f1437d2ae762afdd9f2c (diff)
downloadhypervideo-pre-b662fc8d2033c615ffbdd3b51123b446c03255e8.tar.lz
hypervideo-pre-b662fc8d2033c615ffbdd3b51123b446c03255e8.tar.xz
hypervideo-pre-b662fc8d2033c615ffbdd3b51123b446c03255e8.zip
Merge branch 'master' into gedi
Diffstat (limited to 'youtube_dlc/extractor/bitwave.py')
-rw-r--r--youtube_dlc/extractor/bitwave.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/youtube_dlc/extractor/bitwave.py b/youtube_dlc/extractor/bitwave.py
new file mode 100644
index 000000000..eb16c469d
--- /dev/null
+++ b/youtube_dlc/extractor/bitwave.py
@@ -0,0 +1,61 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class BitwaveReplayIE(InfoExtractor):
+ IE_NAME = 'bitwave:replay'
+ _VALID_URL = r'https?://(?:www\.)?bitwave\.tv/(?P<user>\w+)/replay/(?P<id>\w+)/?$'
+ _TEST = {
+ 'url': 'https://bitwave.tv/RhythmicCarnage/replay/z4P6eq5L7WDrM85UCrVr',
+ 'only_matching': True
+ }
+
+ def _real_extract(self, url):
+ replay_id = self._match_id(url)
+ replay = self._download_json(
+ 'https://api.bitwave.tv/v1/replays/' + replay_id,
+ replay_id
+ )
+
+ return {
+ 'id': replay_id,
+ 'title': replay['data']['title'],
+ 'uploader': replay['data']['name'],
+ 'uploader_id': replay['data']['name'],
+ 'url': replay['data']['url'],
+ 'thumbnails': [
+ {'url': x} for x in replay['data']['thumbnails']
+ ],
+ }
+
+
+class BitwaveStreamIE(InfoExtractor):
+ IE_NAME = 'bitwave:stream'
+ _VALID_URL = r'https?://(?:www\.)?bitwave\.tv/(?P<id>\w+)/?$'
+ _TEST = {
+ 'url': 'https://bitwave.tv/doomtube',
+ 'only_matching': True
+ }
+
+ def _real_extract(self, url):
+ username = self._match_id(url)
+ channel = self._download_json(
+ 'https://api.bitwave.tv/v1/channels/' + username,
+ username)
+
+ formats = self._extract_m3u8_formats(
+ channel['data']['url'], username,
+ 'mp4')
+ self._sort_formats(formats)
+
+ return {
+ 'id': username,
+ 'title': self._live_title(channel['data']['title']),
+ 'uploader': username,
+ 'uploader_id': username,
+ 'formats': formats,
+ 'thumbnail': channel['data']['thumbnail'],
+ 'is_live': True,
+ 'view_count': channel['data']['viewCount']
+ }