返回提交历史
Modified
g4f/Provider/Bixin123.py
+6
-1
XFEstudio/gpt4free
feat(g4f/Provider/Bixin123.py): implement dynamic fingerprint generation
2e3d60a5
代码差异
1 个文件
+6
-1
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
3
3
from aiohttp import ClientSession
4
4
import json
5
import random
5
6
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
6
7
from ..typing import AsyncResult, Messages
7
8
from .helper import format_prompt
@@ -30,6 +31,10 @@ class Bixin123(AsyncGeneratorProvider, ProviderModelMixin):
30
31
else:
31
32
return cls.default_model
32
33
34
@classmethod
35
def generate_fingerprint(cls) -> str:
36
return str(random.randint(100000000, 999999999))
37
33
38
@classmethod
34
39
async def create_async_generator(
35
40
cls,
@@ -45,7 +50,7 @@ class Bixin123(AsyncGeneratorProvider, ProviderModelMixin):
45
50
"accept-language": "en-US,en;q=0.9",
46
51
"cache-control": "no-cache",
47
52
"content-type": "application/json",
48
"fingerprint": "988148794",
53
"fingerprint": cls.generate_fingerprint(),
49
54
"origin": cls.url,
50
55
"pragma": "no-cache",
51
56
"priority": "u=1, i",