mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-27 13:42:19 +03:00
Remove fake_useragent module
This commit is contained in:
parent
eb0e2c6a93
commit
2dbeb54608
@ -4,7 +4,6 @@ import json
|
||||
import time
|
||||
import base64
|
||||
from curl_cffi.requests import AsyncSession
|
||||
from fake_useragent import UserAgent
|
||||
|
||||
from .base_provider import AsyncProvider, format_prompt, get_cookies
|
||||
|
||||
@ -25,7 +24,6 @@ class PerplexityAi(AsyncProvider):
|
||||
) -> str:
|
||||
url = cls.url + "/socket.io/?EIO=4&transport=polling"
|
||||
headers = {
|
||||
"User-Agent": UserAgent().random,
|
||||
"Referer": f"{cls.url}/"
|
||||
}
|
||||
async with AsyncSession(headers=headers, proxies={"https": proxy}, impersonate="chrome107") as session:
|
||||
@ -44,8 +42,6 @@ class PerplexityAi(AsyncProvider):
|
||||
response = await session.get(url, params={"t": timestamp(), "sid": sid})
|
||||
response.raise_for_status()
|
||||
|
||||
print(session.cookies)
|
||||
|
||||
data = '40{"jwt":"anonymous-ask-user"}'
|
||||
response = await session.post(url, params={"t": timestamp(), "sid": sid}, data=data)
|
||||
response.raise_for_status()
|
||||
|
Loading…
Reference in New Issue
Block a user