def _get_streams(self):
    if (self.response is None):
        infos = self.session.http.get(self.url, schema=self._ctcomp_schema)
    else:
        infos = self.session.http.json(self.response, schema=self._ctcomp_schema)
    if (not infos):
        raise PluginError('Cannot find playlist infos!')
    vod_prio = (len(infos) == 2)
    for info in infos:
        try:
            pl = info['ctcomp-data']['source']['playlist'][0]
        except KeyError:
            raise PluginError('Cannot find playlist info!')
        pl = self._playlist_info_schema.validate(pl)
        if (vod_prio and (pl['type'] != 'VOD')):
            continue
        log.trace('{0!r}'.format(info))
        if (pl['type'] == 'LIVE'):
            data = {'contentType': 'live', 'items': [{'id': pl['id'], 'assetId': pl['assetId'], 'key': pl['key'], 'playerType': 'dash', 'date': pl['date'], 'requestSource': pl['requestSource'], 'drm': pl['drm'], 'quality': pl['quality']}]}
        elif (pl['type'] == 'VOD'):
            data = {'contentType': 'vod', 'items': [{'id': pl['id'], 'key': pl['key'], 'playerType': 'dash', 'date': pl['date'], 'requestSource': pl['requestSource'], 'drm': pl['drm'], 'canBePlay': pl['canBePlay'], 'quality': pl['quality'], 'region': pl['region']}]}
    headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
    data = json.dumps(data)
    response = self.session.http.post(self._player_api, data='data={}'.format(quote(data)), headers=headers)
    json_data = self.session.http.json(response, schema=self._playlist_schema)
    log.trace('{0!r}'.format(json_data))
    playlist = json_data['RESULT']['playlist'][0]['streamUrls']['main']
    (yield from DASHStream.parse_manifest(self.session, playlist).items())
def _get_streams(self):
    if (self.response is None):
        infos = self.session.http.get(self.url, schema=self._ctcomp_schema)
    else:
        infos = self.session.http.json(self.response, schema=self._ctcomp_schema)
    if (not infos):
        raise PluginError('Cannot find playlist infos!')
    vod_prio = (len(infos) == 2)
    for info in infos:
        try:
            pl = info['ctcomp-data']['source']['playlist'][0]
        except KeyError:
            raise PluginError('Cannot find playlist info!')
        pl = self._playlist_info_schema.validate(pl)
        if (vod_prio and (pl['type'] != 'VOD')):
            continue
        log.trace('{0!r}'.format(info))
        if (pl['type'] == 'LIVE'):
            data = {'contentType': 'live', 'items': [{'id': pl['id'], 'assetId': pl['assetId'], 'key': pl['key'], 'playerType': 'dash', 'date': pl['date'], 'requestSource': pl['requestSource'], 'drm': pl['drm'], 'quality': pl['quality']}]}
        elif (pl['type'] == 'VOD'):
            data = {'contentType': 'vod', 'items': [{'id': pl['id'], 'key': pl['key'], 'playerType': 'dash', 'date': pl['date'], 'requestSource': pl['requestSource'], 'drm': pl['drm'], 'canBePlay': pl['canBePlay'], 'quality': pl['quality'], 'region': pl['region']}]}
    headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
    data = json.dumps(data)
    response = self.session.http.post(self._player_api, data='data={}'.format(quote(data)), headers=headers)
    json_data = self.session.http.json(response, schema=self._playlist_schema)
    log.trace('{0!r}'.format(json_data))
    playlist = json_data['RESULT']['playlist'][0]['streamUrls']['main']
    (yield from DASHStream.parse_manifest(self.session, playlist).items())