1 from .common
import InfoExtractor
2 from ..compat
import compat_str
10 class BongaCamsIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?P<host>(?:[^/]+\.)?bongacams\d*\.(?:com|net))/(?P<id>[^/?&#]+)'
13 'url': 'https://de.bongacams.com/azumi-8',
14 'only_matching': True,
16 'url': 'https://cn.bongacams.com/azumi-8',
17 'only_matching': True,
19 'url': 'https://de.bongacams.net/claireashton',
23 'title': r
're:ClaireAshton \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
25 'uploader_id': 'ClaireAshton',
26 'uploader': 'ClaireAshton',
31 'skip_download': True,
35 def _real_extract(self
, url
):
36 mobj
= self
._match
_valid
_url
(url
)
37 host
= mobj
.group('host')
38 channel_id
= mobj
.group('id')
40 amf
= self
._download
_json
(
41 'https://%s/tools/amf.php' % host
, channel_id
,
42 data
=urlencode_postdata((
43 ('method', 'getRoomData'),
44 ('args[]', channel_id
),
46 )), headers
={'X-Requested-With': 'XMLHttpRequest'})
48 server_url
= amf
['localData']['videoServerUrl']
50 uploader_id
= try_get(
51 amf
, lambda x
: x
['performerData']['username'], compat_str
) or channel_id
53 amf
, lambda x
: x
['performerData']['displayName'], compat_str
)
54 like_count
= int_or_none(try_get(
55 amf
, lambda x
: x
['performerData']['loversCount']))
57 formats
= self
._extract
_m
3u8_formats
(
58 '%s/hls/stream_%s/playlist.m3u8' % (server_url
, uploader_id
),
59 channel_id
, 'mp4', m3u8_id
='hls', live
=True)
63 'title': uploader
or uploader_id
,
65 'uploader_id': uploader_id
,
66 'like_count': like_count
,