    async def get_stream_urls(self, protocol, use_api=False, allow_imgplus=True, is_xingxiu=False) -> dict:
        '''
        返回指定协议的所有CDN流
        '''
        streams = {}
        weights = {} # https://cdnweb.huya.com/getUidsDomainList?anchor_uid={anchor_uid}
        room_profile = await self.get_room_profile(use_api=use_api)
        if not use_api:
            try:
                stream_info = room_profile['data'][0]['gameStreamInfoList']
            except KeyError:
                raise Exception(f"{room_profile}")
        else:
            stream_info = room_profile['stream']['baseSteamInfoList']
            weights = json.loads(room_profile['liveData'].get('mStreamRatioWeb', '{}'))
        stream = stream_info[0]
        stream_name = stream['sStreamName']
        suffix, anti_code = stream[f's{protocol}UrlSuffix'], stream[f's{protocol}AntiCode']
        if not allow_imgplus:
            stream_name = stream_name.replace('-imgplus', '')
        anti_code = anti_code if is_xingxiu else \
                    self.__build_query(stream_name, anti_code, _get_uid(self.fake_headers['cookie'], stream_name))
        for stream in stream_info:
            # 优先级<0代表不可用
            priority = (
                stream['iPCPriorityRate'],
                stream['iWebPriorityRate'],
                stream['iMobilePriorityRate']
            )
            if any(rate < 0 for rate in priority):
                continue
            cdn_name = stream['sCdnType']
            secure_url = stream[f's{protocol}Url'].replace('http://', 'https://')
            stream_url = f"{secure_url}/{stream_name}.{suffix}?{anti_code}"
            streams[cdn_name] = stream_url
            if len(weights) < len(stream_info):
                weights[cdn_name] = max(0, *priority)
        return _weight_sorting(streams, weights)
返回指定协议的所有CDN流
biliup/plugins/huya.py