chaturbate streams
[youtube-dl] / youtube_dl / extractor / chaturbate.py
1 # encoding: utf-8
2
3 from .common import InfoExtractor
4
5
6 class ChaturbateIE(InfoExtractor):
7     _VALID_URL = r'https?://(?:www\.)?chaturbate\.com/(?P<id>[^/]+)/?$'
8
9     def _real_extract(self, url):
10         video_id = self._match_id(url)
11         webpage = self._download_webpage(url, video_id)
12
13         m3u8_url = self._search_regex(r"'(https?://.*?\.m3u8)'", webpage, 'playlist')
14
15         formats = self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4')
16
17         return {
18             'id': video_id,
19             'title': self._live_title(video_id),
20             'description': self._html_search_meta('description', webpage, 'description'),
21             'is_live': True,
22             'thumbnail': 'https://cdn-s.highwebmedia.com/uHK3McUtGCG3SMFcd4ZJsRv8/roomimage/%s.jpg' % (video_id,),
23             'formats': formats,
24         }