]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/bitwave.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
6 class BitwaveReplayIE(InfoExtractor
):
7 IE_NAME
= 'bitwave:replay'
8 _VALID_URL
= r
'https?://(?:www\.)?bitwave\.tv/(?P<user>\w+)/replay/(?P<id>\w+)/?$'
10 'url': 'https://bitwave.tv/RhythmicCarnage/replay/z4P6eq5L7WDrM85UCrVr',
14 def _real_extract(self
, url
):
15 replay_id
= self
._match
_id
(url
)
16 replay
= self
._download
_json
(
17 'https://api.bitwave.tv/v1/replays/' + replay_id
,
23 'title': replay
['data']['title'],
24 'uploader': replay
['data']['name'],
25 'uploader_id': replay
['data']['name'],
26 'url': replay
['data']['url'],
28 {'url': x}
for x
in replay
['data']['thumbnails']
33 class BitwaveStreamIE(InfoExtractor
):
34 IE_NAME
= 'bitwave:stream'
35 _VALID_URL
= r
'https?://(?:www\.)?bitwave\.tv/(?P<id>\w+)/?$'
37 'url': 'https://bitwave.tv/doomtube',
41 def _real_extract(self
, url
):
42 username
= self
._match
_id
(url
)
43 channel
= self
._download
_json
(
44 'https://api.bitwave.tv/v1/channels/' + username
,
47 formats
= self
._extract
_m
3u8_formats
(
48 channel
['data']['url'], username
,
50 self
._sort
_formats
(formats
)
54 'title': channel
['data']['title'],
56 'uploader_id': username
,
58 'thumbnail': channel
['data']['thumbnail'],
60 'view_count': channel
['data']['viewCount']