def _get_stream(self, channel): html = self.get_url(channel['link']) stream = research("var m_link = '(.*?)'", html.decode('utf8')) stream = base64.decodestring(stream) if 'tvrec' in stream: return if 'peers' in stream: return return stream
def _get_channels(self): channels = [] soup = self.get_soup(self.baseurl) for index, l in enumerate( soup.findAll('a', { 'target': '_blank', 'href': re.compile('\/\S+\.html') })): try: soup = self.get_soup(self.baseurl + l.get('href')) title = research(u'^(.*?) смотреть онлайн', soup.title.string) logo = self.baseurl + soup.find('img', title=title).get('src') link = soup.find('iframe').get('src') group = self.get_channel_group(l.get('href')) if link: channels.append( dict(title=unicode(title), link=unicode(link), logo=unicode(logo), group=unicode(group))) logger.info('get channel %s', self.baseurl + l.get('href')) except AttributeError: pass except Exception as e: logger.error('%s:%s - %s', self.baseurl, index, repr(e)[:50]) return channels
def _get_stream(self, channel): stream = None html = self.get_url(channel['link']).decode('utf8', 'ignore') if 'wmsAuthSign' in html: sig = research('var signature = "(.*?)"', html) stream = research('url: "(.*?)" \+ signature', html) if stream: stream += sig elif 'rosshow' in html: soup = self._get_soup(html) id_ = soup.find('iframe').get('src').replace( '//rosshow.ru/iframe/', '') stream = 'https://live-rmg.cdnvideo.ru/rmg/' + id_ + '_new.sdp/chunklist.m3u8?hls_proxy_host=pub1.rtmp.s01.l.rmg' else: soup = self._get_soup(html) param = soup.find('param', {'name': 'flashvars'}) if param: stream = research( 'file=(.*)', soup.find('param', { 'name': 'flashvars' }).get('value')) return stream
def _get_stream(self, channel): html = self.get_url(channel['link']) stream = research("acestream://(.*?)\"", html.decode('utf8')) return '/ace/getstream?id=' + stream
def _get_stream(self, channel): html = self.get_url(channel['link']) stream = research('file:"(.*?)"', html.decode('utf8')) return stream
def _get_stream(self, channel): html = self.get_url(channel['link']) stream = research("file: '(.*?)'", html) if not stream: stream = research("file=(.*?m3u8)", html) return stream