From 2e3d60a5f1d60f7443e78e4b5b692bb76a78d51c Mon Sep 17 00:00:00 2001 From: kqlio67 Date: Wed, 11 Sep 2024 21:59:11 +0300 Subject: feat(g4f/Provider/Bixin123.py): implement dynamic fingerprint generation --- g4f/Provider/Bixin123.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'g4f/Provider/Bixin123.py') diff --git a/g4f/Provider/Bixin123.py b/g4f/Provider/Bixin123.py index 694a2eff..39422c93 100644 --- a/g4f/Provider/Bixin123.py +++ b/g4f/Provider/Bixin123.py @@ -2,6 +2,7 @@ from __future__ import annotations from aiohttp import ClientSession import json +import random from .base_provider import AsyncGeneratorProvider, ProviderModelMixin from ..typing import AsyncResult, Messages from .helper import format_prompt @@ -30,6 +31,10 @@ class Bixin123(AsyncGeneratorProvider, ProviderModelMixin): else: return cls.default_model + @classmethod + def generate_fingerprint(cls) -> str: + return str(random.randint(100000000, 999999999)) + @classmethod async def create_async_generator( cls, @@ -45,7 +50,7 @@ class Bixin123(AsyncGeneratorProvider, ProviderModelMixin): "accept-language": "en-US,en;q=0.9", "cache-control": "no-cache", "content-type": "application/json", - "fingerprint": "988148794", + "fingerprint": cls.generate_fingerprint(), "origin": cls.url, "pragma": "no-cache", "priority": "u=1, i", -- cgit v1.2.3