mirror of https://github.com/xtekky/gpt4free.git
Update Liaobots.py
This commit is contained in:
parent
e5e811fd7f
commit
e418c03aa0
|
@ -124,14 +124,12 @@ class Liaobots(AsyncGeneratorProvider, ProviderModelMixin):
|
||||||
if not cls._auth_code:
|
if not cls._auth_code:
|
||||||
async with session.post(
|
async with session.post(
|
||||||
"https://liaobots.work/recaptcha/api/login",
|
"https://liaobots.work/recaptcha/api/login",
|
||||||
proxy=proxy,
|
|
||||||
data={"token": "abcdefghijklmnopqrst"},
|
data={"token": "abcdefghijklmnopqrst"},
|
||||||
verify_ssl=False
|
verify_ssl=False
|
||||||
) as response:
|
) as response:
|
||||||
await raise_for_status(response)
|
await raise_for_status(response)
|
||||||
async with session.post(
|
async with session.post(
|
||||||
"https://liaobots.work/api/user",
|
"https://liaobots.work/api/user",
|
||||||
proxy=proxy,
|
|
||||||
json={"authcode": ""},
|
json={"authcode": ""},
|
||||||
verify_ssl=False
|
verify_ssl=False
|
||||||
) as response:
|
) as response:
|
||||||
|
@ -148,7 +146,6 @@ class Liaobots(AsyncGeneratorProvider, ProviderModelMixin):
|
||||||
}
|
}
|
||||||
async with session.post(
|
async with session.post(
|
||||||
"https://liaobots.work/api/chat",
|
"https://liaobots.work/api/chat",
|
||||||
proxy=proxy,
|
|
||||||
json=data,
|
json=data,
|
||||||
headers={"x-auth-code": cls._auth_code},
|
headers={"x-auth-code": cls._auth_code},
|
||||||
verify_ssl=False
|
verify_ssl=False
|
||||||
|
@ -158,4 +155,4 @@ class Liaobots(AsyncGeneratorProvider, ProviderModelMixin):
|
||||||
if b"<html coupert-item=" in chunk:
|
if b"<html coupert-item=" in chunk:
|
||||||
raise RuntimeError("Invalid session")
|
raise RuntimeError("Invalid session")
|
||||||
if chunk:
|
if chunk:
|
||||||
yield chunk.decode()
|
yield chunk.decode(errors="ignore")
|
||||||
|
|
Loading…
Reference in New Issue