def ckplayer_get_info_by_xml(ckinfo):
 e = ET.XML(ckinfo)
 video_dict = {'title': '', 'links': [], 'size': 0, 'flashvars': ''}
 if ('_text' in dictify(e)['ckplayer']['info'][0]['title'][0]):
  video_dict['title'] = dictify(e)['ckplayer']['info'][0]['title'][0]['_text'].strip()
 if ('_text' in dictify(e)['ckplayer']['video'][0]['size'][0]):
  video_dict['size'] = sum([int(i['size'][0]['_text']) for i in dictify(e)['ckplayer']['video']])
 if ('_text' in dictify(e)['ckplayer']['video'][0]['file'][0]):
  video_dict['links'] = [i['file'][0]['_text'].strip() for i in dictify(e)['ckplayer']['video']]
 if ('_text' in dictify(e)['ckplayer']['flashvars'][0]):
  video_dict['flashvars'] = dictify(e)['ckplayer']['flashvars'][0]['_text'].strip()
 return video_dict

def ckplayer_get_info_by_xml ( ckinfo ) : e = ET . XML ( ckinfo ) video_dict = { 'title' : '' , 'links' : [ ] , 'size' : 0 , 'flashvars' : '' } if ( '_text' in dictify ( e ) [ 'ckplayer' ] [ 'info' ] [ 0 ] [ 'title' ] [ 0 ] ) : video_dict [ 'title' ] = dictify ( e ) [ 'ckplayer' ] [ 'info' ] [ 0 ] [ 'title' ] [ 0 ] [ '_text' ] . strip ( ) if ( '_text' in dictify ( e ) [ 'ckplayer' ] [ 'video' ] [ 0 ] [ 'size' ] [ 0 ] ) : video_dict [ 'size' ] = sum ( [ int ( i [ 'size' ] [ 0 ] [ '_text' ] ) for i in dictify ( e ) [ 'ckplayer' ] [ 'video' ] ] ) if ( '_text' in dictify ( e ) [ 'ckplayer' ] [ 'video' ] [ 0 ] [ 'file' ] [ 0 ] ) : video_dict [ 'links' ] = [ i [ 'file' ] [ 0 ] [ '_text' ] . strip ( ) for i in dictify ( e ) [ 'ckplayer' ] [ 'video' ] ] if ( '_text' in dictify ( e ) [ 'ckplayer' ] [ 'flashvars' ] [ 0 ] ) : video_dict [ 'flashvars' ] = dictify ( e ) [ 'ckplayer' ] [ 'flashvars' ] [ 0 ] [ '_text' ] . strip ( ) return video_dict
str->dict information for ckplayer api content .