1 from .common
import InfoExtractor
4 class CAM4IE(InfoExtractor
):
5 _VALID_URL
= r
'https?://(?:[^/]+\.)?cam4\.com/(?P<id>[a-z0-9_]+)'
7 'url': 'https://www.cam4.com/foxynesss',
11 'title': 're:^foxynesss [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
13 'live_status': 'is_live',
14 'thumbnail': 'https://snapshots.xcdnpro.com/thumbnails/foxynesss',
18 def _real_extract(self
, url
):
19 channel_id
= self
._match
_id
(url
)
20 m3u8_playlist
= self
._download
_json
(f
'https://www.cam4.com/rest/v1.0/profile/{channel_id}/streamInfo', channel_id
).get('cdnURL')
22 formats
= self
._extract
_m
3u8_formats
(m3u8_playlist
, channel_id
, 'mp4', m3u8_id
='hls', live
=True)
30 'thumbnail': f
'https://snapshots.xcdnpro.com/thumbnails/{channel_id}',