1 from __future__ import unicode_literals
3 from .common import InfoExtractor
4 from ..utils import ExtractorError
7 class ChaturbateIE(InfoExtractor):
8 _VALID_URL = r'https?://(?:[^/]+\.)?chaturbate\.com/(?P<id>[^/?#]+)'
10 'url': 'https://www.chaturbate.com/siswet19/',
14 'title': 're:^siswet19 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
19 'skip_download': True,
22 'url': 'https://en.chaturbate.com/siswet19/',
23 'only_matching': True,
26 def _real_extract(self, url):
27 video_id = self._match_id(url)
29 webpage = self._download_webpage(url, video_id)
31 m3u8_url = self._search_regex(
32 r'src=(["\'])(?P<url>http.+?\.m3u8.*?)\1', webpage,
33 'playlist', default=None, group='url')
36 error = self._search_regex(
37 r'<span[^>]+class=(["\'])desc_span\1[^>]*>(?P<error>[^<]+)</span>',
38 webpage, 'error', group='error')
39 raise ExtractorError(error, expected=True)
41 formats = self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4')
45 'title': self._live_title(video_id),
46 'thumbnail': 'https://cdn-s.highwebmedia.com/uHK3McUtGCG3SMFcd4ZJsRv8/roomimage/%s.jpg' % video_id,
47 'age_limit': self._rta_search(webpage),