diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-01-29 18:14:46 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-01-29 18:14:46 +0100 |
commit | a28bab938704a15c825c1b45a8983c72e8c90ace (patch) | |
tree | 0a3ee26bb1f9e7bf7c1a5a739ed59015248acbfb /g4f/requests_aiohttp.py | |
parent | Merge pull request #1523 from u66u/which-webdriver (diff) | |
download | gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.gz gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.bz2 gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.lz gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.xz gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.zst gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/requests_aiohttp.py | 13 |
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__( |