1 from .common
import InfoExtractor
9 class BongaCamsIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?P<host>(?:[^/]+\.)?bongacams\d*\.(?:com|net))/(?P<id>[^/?&#]+)'
12 'url': 'https://de.bongacams.com/azumi-8',
13 'only_matching': True,
15 'url': 'https://cn.bongacams.com/azumi-8',
16 'only_matching': True,
18 'url': 'https://de.bongacams.net/claireashton',
22 'title': r
're:ClaireAshton \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
24 'uploader_id': 'ClaireAshton',
25 'uploader': 'ClaireAshton',
30 'skip_download': True,
34 def _real_extract(self
, url
):
35 mobj
= self
._match
_valid
_url
(url
)
36 host
= mobj
.group('host')
37 channel_id
= mobj
.group('id')
39 amf
= self
._download
_json
(
40 f
'https://{host}/tools/amf.php', channel_id
,
41 data
=urlencode_postdata((
42 ('method', 'getRoomData'),
43 ('args[]', channel_id
),
45 )), headers
={'X-Requested-With': 'XMLHttpRequest'})
47 server_url
= amf
['localData']['videoServerUrl']
49 uploader_id
= try_get(
50 amf
, lambda x
: x
['performerData']['username'], str) or channel_id
52 amf
, lambda x
: x
['performerData']['displayName'], str)
53 like_count
= int_or_none(try_get(
54 amf
, lambda x
: x
['performerData']['loversCount']))
56 formats
= self
._extract
_m
3u8_formats
(
57 f
'{server_url}/hls/stream_{uploader_id}/playlist.m3u8',
58 channel_id
, 'mp4', m3u8_id
='hls', live
=True)
62 'title': uploader
or uploader_id
,
64 'uploader_id': uploader_id
,
65 'like_count': like_count
,