Merge pull request #965 from QQisQQ/patch-2
解决new bing 报错200 (fix new bing error code 200 )
This commit is contained in:
		
						commit
						99b8fce8f3
					
				@ -447,6 +447,15 @@ class _ChatHub:
 | 
				
			|||||||
        """
 | 
					        """
 | 
				
			||||||
        Ask a question to the bot
 | 
					        Ask a question to the bot
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
 | 
					        req_header = HEADERS
 | 
				
			||||||
 | 
					        if self.cookies is not None:
 | 
				
			||||||
 | 
					            ws_cookies = []
 | 
				
			||||||
 | 
					            for cookie in self.cookies:
 | 
				
			||||||
 | 
					                ws_cookies.append(f"{cookie['name']}={cookie['value']}")
 | 
				
			||||||
 | 
					            req_header.update({
 | 
				
			||||||
 | 
					                'Cookie': ';'.join(ws_cookies),
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
        timeout = aiohttp.ClientTimeout(total=30)
 | 
					        timeout = aiohttp.ClientTimeout(total=30)
 | 
				
			||||||
        self.session = aiohttp.ClientSession(timeout=timeout)
 | 
					        self.session = aiohttp.ClientSession(timeout=timeout)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -455,7 +464,7 @@ class _ChatHub:
 | 
				
			|||||||
        # Check if websocket is closed
 | 
					        # Check if websocket is closed
 | 
				
			||||||
        self.wss = await self.session.ws_connect(
 | 
					        self.wss = await self.session.ws_connect(
 | 
				
			||||||
            wss_link,
 | 
					            wss_link,
 | 
				
			||||||
            headers=HEADERS,
 | 
					            headers=req_header,
 | 
				
			||||||
            ssl=ssl_context,
 | 
					            ssl=ssl_context,
 | 
				
			||||||
            proxy=self.proxy,
 | 
					            proxy=self.proxy,
 | 
				
			||||||
            autoping=False,
 | 
					            autoping=False,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user