summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorkqlio67 <kqlio67@users.noreply.github.com>2024-10-02 23:49:11 +0200
committerkqlio67 <kqlio67@users.noreply.github.com>2024-10-02 23:49:11 +0200
commit96035435b4f8c6ed8df4246f4bf3627817f474d7 (patch)
tree935a943fcb1c3c577f9bf40f62c7db11d1538bac /g4f
parentrefactor(g4f/Provider/LiteIcoding.py): encode bearer tokens and add decoding (diff)
downloadgpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.tar
gpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.tar.gz
gpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.tar.bz2
gpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.tar.lz
gpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.tar.xz
gpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.tar.zst
gpt4free-96035435b4f8c6ed8df4246f4bf3627817f474d7.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/MagickPen.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/g4f/Provider/MagickPen.py b/g4f/Provider/MagickPen.py
index b6a47417..c15a59f5 100644
--- a/g4f/Provider/MagickPen.py
+++ b/g4f/Provider/MagickPen.py
@@ -24,21 +24,18 @@ class MagickPen(AsyncGeneratorProvider, ProviderModelMixin):
@classmethod
async def fetch_api_credentials(cls) -> tuple:
- url = "https://magickpen.com/_nuxt/9e47cd7579e60a9d1f13.js"
+ url = "https://magickpen.com/_nuxt/bf709a9ce19f14e18116.js"
async with ClientSession() as session:
async with session.get(url) as response:
text = await response.text()
- # Extract the necessary values from the file
pattern = r'"X-API-Secret":"(\w+)"'
match = re.search(pattern, text)
X_API_SECRET = match.group(1) if match else None
- # Generate timestamp and nonce
- timestamp = str(int(time.time() * 1000)) # in milliseconds
+ timestamp = str(int(time.time() * 1000))
nonce = str(random.random())
- # Generate the signature
s = ["TGDBU9zCgM", timestamp, nonce]
s.sort()
signature_string = ''.join(s)