]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/cam4.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class CAM4IE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:[^/]+\.)?cam4\.com/(?P<id>[a-z0-9_]+)'
10 'url': 'https://www.cam4.com/foxynesss',
14 'title': 're:^foxynesss [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
19 def _real_extract(self
, url
):
20 channel_id
= self
._match
_id
(url
)
21 m3u8_playlist
= self
._download
_json
('https://www.cam4.com/rest/v1.0/profile/{}/streamInfo'.format(channel_id
), channel_id
).get('cdnURL')
23 formats
= self
._extract
_m
3u8_formats
(m3u8_playlist
, channel_id
, 'mp4', m3u8_id
='hls', live
=True)
24 self
._sort
_formats
(formats
)