def get_config(self):
""" Sets the different RTMP properties. """
if self.room_pass:
_url = self._config_url_pw.format(self.room_name, self.room_pass)
else:
_url = self._config_url.format(self.room_name)
_response = util.web.http_get(url=_url, proxy=self.proxy)
log.debug('room config response: %s' % _response)
if _response['content'] is not None:
try:
_xml = parseString(_response['content'])
except ExpatError as e:
log.error('ExpatError: %s' % e)
_xml = None
if _xml is not None:
root = _xml.getElementsByTagName('response')[0]
# set the config_status property.
self._config_status = root.getAttribute('result')
if self._config_status != 'PW' or self._config_status != 'CLOSED':
# set the roomtype property.
self._roomtype = root.getAttribute('roomtype')
# set the tc_url property.
self._tc_url = root.getAttribute('rtmp')
if root.getAttribute('greenroom'):
# set the is_greenroom property.
self._greenroom = True
if 'bpassword' in _response['content']:
# set the bpassword property.
self._bpassword = root.getAttribute('bpassword')
params.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录