diff options
Diffstat (limited to 'g4f/Provider/MagickPen.py')
-rw-r--r-- | g4f/Provider/MagickPen.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/g4f/Provider/MagickPen.py b/g4f/Provider/MagickPen.py index b6a47417..7f1751dd 100644 --- a/g4f/Provider/MagickPen.py +++ b/g4f/Provider/MagickPen.py @@ -14,7 +14,6 @@ class MagickPen(AsyncGeneratorProvider, ProviderModelMixin): url = "https://magickpen.com" api_endpoint = "https://api.magickpen.com/ask" working = True - supports_gpt_4 = True supports_stream = True supports_system_message = True supports_message_history = True @@ -24,21 +23,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) |