summaryrefslogtreecommitdiffstats
path: root/g4f/requests_aiohttp.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-29 20:37:59 +0100
committerGitHub <noreply@github.com>2024-01-29 20:37:59 +0100
commit280ddf57b0f54d1805f1ee26aa699469019e731f (patch)
treecabcbf5fa9a5dbf75a223377dbf032cfeb3e1027 /g4f/requests_aiohttp.py
parentMerge pull request #1523 from u66u/which-webdriver (diff)
parentImprove readme / unittests (diff)
downloadgpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.gz
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.bz2
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.lz
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.xz
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.zst
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.zip
Diffstat (limited to 'g4f/requests_aiohttp.py')
-rw-r--r--g4f/requests_aiohttp.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/g4f/requests_aiohttp.py b/g4f/requests_aiohttp.py
index aa097312..0da8973b 100644
--- a/g4f/requests_aiohttp.py
+++ b/g4f/requests_aiohttp.py
@@ -4,6 +4,7 @@ from aiohttp import ClientSession, ClientResponse, ClientTimeout
from typing import AsyncGenerator, Any
from .Provider.helper import get_connector
+from .defaults import DEFAULT_HEADERS
class StreamResponse(ClientResponse):
async def iter_lines(self) -> AsyncGenerator[bytes, None]:
@@ -17,17 +18,7 @@ class StreamSession(ClientSession):
def __init__(self, headers: dict = {}, timeout: int = None, proxies: dict = {}, impersonate = None, **kwargs):
if impersonate:
headers = {
- 'Accept-Encoding': 'gzip, deflate, br',
- 'Accept-Language': 'en-US',
- 'Connection': 'keep-alive',
- 'Sec-Fetch-Dest': 'empty',
- 'Sec-Fetch-Mode': 'cors',
- 'Sec-Fetch-Site': 'same-site',
- "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
- 'Accept': '*/*',
- 'sec-ch-ua': '"Google Chrome";v="107", "Chromium";v="107", "Not?A_Brand";v="24"',
- 'sec-ch-ua-mobile': '?0',
- 'sec-ch-ua-platform': '"Windows"',
+ **DEFAULT_HEADERS,
**headers
}
super().__init__(