def _get_streams(self):
    self.session.http.headers.update({'User-Agent': useragents.IPAD})
    self.session.http.verify = False
    log.warning('SSL certificate verification is disabled.')
    response = self.session.http.get(self.url)
    info = self._find_playlist_info(response)
    if (not info):

        def _fallback_api(*args, **kwargs):
            self.api2 = CeskatelevizeAPI2(self.session, self.url, *args, **kwargs)
            return self.api2._get_streams()
        player_url = self._find_player_url(response)
        if (not player_url):
            log.debug('Cannot find playlist info or player url, do next try with new API')
            return _fallback_api(res=response)
        response = self.session.http.get(player_url)
        info = self._find_playlist_info(response)
        if (not info):
            log.debug('Cannot find playlist info in the player url, do next try with new API')
            return _fallback_api()
    log.trace('{0!r}'.format(info))
    data = {'playlist[0][type]': info['type'], 'playlist[0][id]': info['id'], 'requestUrl': '/ivysilani/embed/iFramePlayer.php', 'requestSource': 'iVysilani', 'type': 'html'}
    headers = {'x-addr': '127.0.0.1'}
    response = self.session.http.post(self.ajax_url, data=data, headers=headers)
    json_data = self.session.http.json(response, schema=self._playlist_url_schema)
    log.trace('{0!r}'.format(json_data))
    if (json_data['url'] in ['Error', 'error_region']):
        log.error('This stream is not available')
        return
    response = self.session.http.post(json_data['url'])
    json_data = self.session.http.json(response, schema=self._playlist_schema)
    log.trace('{0!r}'.format(json_data))
    playlist = json_data['playlist'][0]['streamUrls']['main']
    return HLSStream.parse_variant_playlist(self.session, playlist)
def _get_streams(self):
    self.session.http.headers.update({'User-Agent': useragents.IPAD})
    self.session.http.verify = False
    log.warning('SSL certificate verification is disabled.')
    response = self.session.http.get(self.url)
    info = self._find_playlist_info(response)
    if (not info):

        def _fallback_api(*args, **kwargs):
            self.api2 = CeskatelevizeAPI2(self.session, self.url, *args, **kwargs)
            return self.api2._get_streams()
        player_url = self._find_player_url(response)
        if (not player_url):
            log.debug('Cannot find playlist info or player url, do next try with new API')
            return _fallback_api(res=response)
        response = self.session.http.get(player_url)
        info = self._find_playlist_info(response)
        if (not info):
            log.debug('Cannot find playlist info in the player url, do next try with new API')
            return _fallback_api()
    log.trace('{0!r}'.format(info))
    data = {'playlist[0][type]': info['type'], 'playlist[0][id]': info['id'], 'requestUrl': '/ivysilani/embed/iFramePlayer.php', 'requestSource': 'iVysilani', 'type': 'html'}
    headers = {'x-addr': '127.0.0.1'}
    response = self.session.http.post(self.ajax_url, data=data, headers=headers)
    json_data = self.session.http.json(response, schema=self._playlist_url_schema)
    log.trace('{0!r}'.format(json_data))
    if (json_data['url'] in ['Error', 'error_region']):
        log.error('This stream is not available')
        return
    response = self.session.http.post(json_data['url'])
    json_data = self.session.http.json(response, schema=self._playlist_schema)
    log.trace('{0!r}'.format(json_data))
    playlist = json_data['playlist'][0]['streamUrls']['main']
    return HLSStream.parse_variant_playlist(self.session, playlist)