summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorluna <71488561+piotr25691@users.noreply.github.com>2024-02-19 10:43:03 +0100
committerGitHub <noreply@github.com>2024-02-19 10:43:03 +0100
commitd18e3816ca4c841736355f127f7777cab8ee6c0c (patch)
treebcff6d556f8837f890a9888ec0a7f0118d73259d /g4f
parentMerge pull request #1597 from xtekky/index (diff)
downloadgpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.tar
gpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.tar.gz
gpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.tar.bz2
gpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.tar.lz
gpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.tar.xz
gpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.tar.zst
gpt4free-d18e3816ca4c841736355f127f7777cab8ee6c0c.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/Provider/GeminiProChat.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/g4f/Provider/GeminiProChat.py b/g4f/Provider/GeminiProChat.py
index 32c86332..488f5f0e 100644
--- a/g4f/Provider/GeminiProChat.py
+++ b/g4f/Provider/GeminiProChat.py
@@ -9,7 +9,7 @@ from .base_provider import AsyncGeneratorProvider
class GeminiProChat(AsyncGeneratorProvider):
- url = "https://geminiprochat.com"
+ url = "https://gemini-chatbot-sigma.vercel.app"
working = True
supports_gpt_35_turbo = True
@@ -22,13 +22,13 @@ class GeminiProChat(AsyncGeneratorProvider):
**kwargs
) -> AsyncResult:
headers = {
- "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0",
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0",
"Accept": "*/*",
- "Accept-Language": "de,en-US;q=0.7,en;q=0.3",
+ "Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "text/plain;charset=UTF-8",
- "Referer": "https://geminiprochat.com/",
- "Origin": "https://geminiprochat.com",
+ "Referer": "https://gemini-chatbot-sigma.vercel.app/",
+ "Origin": "https://gemini-chatbot-sigma.vercel.app",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
@@ -51,6 +51,7 @@ class GeminiProChat(AsyncGeneratorProvider):
async for chunk in response.content.iter_any():
yield chunk.decode()
-def generate_signature(time: int, text: str):
- message = f'{time}:{text}:9C4680FB-A4E1-6BC7-052A-7F68F9F5AD1F';
+def generate_signature(time: int, text: str, secret: str = ""):
+ message = f'{time}:{text}:{secret}';
return sha256(message.encode()).hexdigest()
+