1 from __future__ import unicode_literals
3 from .common import InfoExtractor
6 class CamWithHerIE(InfoExtractor):
7 _VALID_URL = r'https?://(?:www\.)?camwithher\.tv/view_video\.php\?.*viewkey=(?P<id>\w+)'
11 'url': 'http://camwithher.tv/view_video.php?viewkey=6e9a24e2c0e842e1f177&page=&viewtype=&category=',
15 'title': 'Periscope Tease',
18 'skip_download': True,
22 'url': 'http://camwithher.tv/view_video.php?viewkey=6dfd8b7c97531a459937',
23 'only_matching': True,
26 'url': 'http://camwithher.tv/view_video.php?page=&viewkey=6e9a24e2c0e842e1f177&viewtype=&category=',
27 'only_matching': True,
30 'url': 'http://camwithher.tv/view_video.php?viewkey=b6c3b5bea9515d1a1fc4&page=&viewtype=&category=mv',
31 'only_matching': True,
35 def _real_extract(self, url):
36 video_id = self._match_id(url)
38 webpage = self._download_webpage(url, video_id)
40 flv_id = self._html_search_regex(r'<a href="/download/\?v=(\d+)', webpage, 'id')
42 # The number "2010" was reverse-engineered from cwhplayer.swf.
43 # It appears that they changed their video codec, and hence the RTMP URL
44 # scheme at that video's ID.
45 rtmp_url = 'rtmp://camwithher.tv/clipshare/%s' % (('mp4:%s.mp4' % flv_id) if int(flv_id) > 2010 else flv_id)
47 title = self._html_search_regex(r'<div style="float:left">\s+<h2>(.+?)</h2>', webpage, 'title')