core.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:showroom 作者: wlerin 项目源码 文件源码
def update_streaming_url_web(self):
        """Updates streaming urls from the showroom website.

        Fallback if api changes again"""
        r = self._session.get(self._room.long_url)

        if r.ok:
            match = hls_url_re1.search(r.text)
            # TODO: check if there was a match
            if not match:
                # no url found in the page
                # probably the stream has ended but is_live returned true
                # just don't update the urls
                # except what happens if they are still "" ?
                return
            hls_url = match.group(0)
            rtmps_url = match.group(1).replace('https', 'rtmps')
            rtmp_url = "rtmp://{}.{}.{}.{}:1935/liveedge/{}".format(*match.groups()[1:])
            with self._lock:
                self._rtmp_url = rtmp_url
                self._hls_url = hls_url
                self._rtmps_url = rtmps_url
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号