Open Seminko opened 1 year ago
FYI - still not fixed.
HTML being printed is intended for debug purposes
Would be great if there was an option to turn if off.
You should probably use the latest python version 3.11.3
Because the error isn't happening in it
When printing HTML page into console, it also throws an "Exception: Authentication failed".
I think my cookies has been expired, but when I relogin my account in Edge and Chrome and get the new cookies, this problem remains. It has been 3 days since this bug occured and it's still not fixed even I updat EdgeGPT and python to the latest version. After reviews the code, I find that it returned 502 when accessing https://edge.churchless.tech/edgesvc/turing/conversation/create
The fallback proxy is dead
im solved it using proxy generator, look at my repository - Jarvis voice assistant :) shortly saying : 1) pip install proxybroker2 2) creating file proxies.txt and adding 10 ip proxy to it
def proxy_file():
import asyncio
from proxybroker import Broker
async def save(proxies, filename):
"""Save proxies to a file."""
with open(filename, 'w') as f:
while True:
proxy = await proxies.get()
if proxy is None:
break
f.write('%s:%d\n' % (proxy.host, proxy.port))
def main():
proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(broker.grab(countries=['US', 'GB'], limit=10),
save(proxies, filename='proxies.txt'))
loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)
main()
if __name__ == '__main__':
proxy_file()
3)
def read_proxies(filename='proxies.txt'):
'''
read proxies , return list with ['http://123:89'] # prefix http
'''
with open(filename, 'r') as f:
lines = f.readlines()
proxies = ['http://' + line.strip() for line in lines if line.strip()]
return proxies
if __name__ =='__main__':
proxies = read_proxies('proxies.txt')
print(proxies)
4) something like this
def proxy_start_bot():
global bot
for proxy in proxy_list:
try:
bot = Chatbot(cookie_path='cookies.json', proxy=proxy)
break
except Exception as e:
print(f"error {proxy}: {e}")
proxy_list = read_proxies() proxy_start_bot() ... hope you got the idea 😊 p.s. im using EdgeGPT==0.2.0
Is there an existing issue for this?
What happened?
From time to time, EdgeGPT apparently gets a 502 and decides to print the whole HTML into console.
Cloudflare is mentioned...
Steps to reproduce the problem
Don't know how to reproduce
What should have happened?
The whole HTML should not have been prited. Whether the http status should have been printed is debatable.
Version where the problem happens
0.10.13
What Python version are you running this with?
3.9.16
What is your operating system ?
Windows
Command Line Arguments
Console logs
Block of code
``` Status code: 502Bad gateway Error code 502
Browser
WorkingCloudflare
WorkingHost
ErrorWhat happened?
The web server reported a bad gateway error.
What can I do?
Please try again in a few minutes.
Cloudflare Ray ID: 7d71ae1edbb2b32a • Your IP: 86.49.253.196 • Performance & security by Cloudflare
Additional information
No response