XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Remove fake_useragent module

2dbeb546
Heiner Lohaus <heiner@lohaus.eu>
提交于

代码差异

1 个文件 +0 -4
Modified g4f/Provider/PerplexityAi.py +0 -4
@@ -4,7 +4,6 @@ import json
4 4 import time
5 5 import base64
6 6 from curl_cffi.requests import AsyncSession
7 from fake_useragent import UserAgent
8 7
9 8 from .base_provider import AsyncProvider, format_prompt, get_cookies
10 9
@@ -25,7 +24,6 @@ class PerplexityAi(AsyncProvider):
25 24 ) -> str:
26 25 url = cls.url + "/socket.io/?EIO=4&transport=polling"
27 26 headers = {
28 "User-Agent": UserAgent().random,
29 27 "Referer": f"{cls.url}/"
30 28 }
31 29 async with AsyncSession(headers=headers, proxies={"https": proxy}, impersonate="chrome107") as session:
@@ -44,8 +42,6 @@ class PerplexityAi(AsyncProvider):
44 42 response = await session.get(url, params={"t": timestamp(), "sid": sid})
45 43 response.raise_for_status()
46 44
47 print(session.cookies)
48
49 45 data = '40{"jwt":"anonymous-ask-user"}'
50 46 response = await session.post(url, params={"t": timestamp(), "sid": sid}, data=data)
51 47 response.raise_for_status()