summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/You.py
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2024-04-14 03:37:15 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2024-04-14 03:37:15 +0200
commit8add819c3e1f093466673f1d946d6ee78cc5baa3 (patch)
tree1cdada0b1ed181b5c0886cc59aa87f6c024615d4 /g4f/Provider/You.py
parentnew gpt-4 beating opensource models (diff)
downloadgpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.tar
gpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.tar.gz
gpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.tar.bz2
gpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.tar.lz
gpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.tar.xz
gpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.tar.zst
gpt4free-8add819c3e1f093466673f1d946d6ee78cc5baa3.zip
Diffstat (limited to 'g4f/Provider/You.py')
-rw-r--r--g4f/Provider/You.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/g4f/Provider/You.py b/g4f/Provider/You.py
index be4ab523..3ebd40f2 100644
--- a/g4f/Provider/You.py
+++ b/g4f/Provider/You.py
@@ -65,6 +65,7 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
timeout=(30, timeout)
) as session:
cookies = await cls.get_cookies(session) if chat_mode != "default" else None
+
upload = json.dumps([await cls.upload_file(session, cookies, to_bytes(image), image_name)]) if image else ""
headers = {
"Accept": "text/event-stream",
@@ -131,6 +132,7 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
@classmethod
async def get_cookies(cls, client: StreamSession) -> Cookies:
+
if not cls._cookies or cls._cookies_used >= 5:
cls._cookies = await cls.create_cookies(client)
cls._cookies_used = 0
@@ -151,8 +153,8 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
}}).encode()).decode()
def get_auth() -> str:
- auth_uuid = "507a52ad-7e69-496b-aee0-1c9863c7c8"
- auth_token = f"public-token-live-{auth_uuid}bb:public-token-live-{auth_uuid}19"
+ auth_uuid = "507a52ad-7e69-496b-aee0-1c9863c7c819"
+ auth_token = f"public-token-live-{auth_uuid}:public-token-live-{auth_uuid}"
auth = base64.standard_b64encode(auth_token.encode()).decode()
return f"Basic {auth}"
@@ -172,12 +174,12 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
"dfp_telemetry_id": await get_dfp_telemetry_id(),
"email": f"{user_uuid}@gmail.com",
"password": f"{user_uuid}#{user_uuid}",
- "dfp_telemetry_id": f"{uuid.uuid4()}",
"session_duration_minutes": 129600
}
) as response:
await raise_for_status(response)
session = (await response.json())["data"]
+
return {
"stytch_session": session["session_token"],
'stytch_session_jwt': session["session_jwt"],