From dccd63a1e2a919037e1b4b44a180e98f2afa4530 Mon Sep 17 00:00:00 2001 From: dolfies Date: Sun, 1 Dec 2024 08:10:51 -0500 Subject: [PATCH] Even further fixes --- curl_cffi/requests/options.py | 4 ++-- curl_cffi/requests/session.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/curl_cffi/requests/options.py b/curl_cffi/requests/options.py index f5151bf..f816fa0 100644 --- a/curl_cffi/requests/options.py +++ b/curl_cffi/requests/options.py @@ -605,8 +605,8 @@ def set_curl_options( # set extra curl options, must come after impersonate, because it will alter some options if curl_options: - for k, v in curl_options.items(): - c.setopt(k, v) + for option, setting in curl_options.items(): + c.setopt(option, setting) buffer = None q = None diff --git a/curl_cffi/requests/session.py b/curl_cffi/requests/session.py index fb9b329..fd8e895 100644 --- a/curl_cffi/requests/session.py +++ b/curl_cffi/requests/session.py @@ -771,7 +771,6 @@ async def ws_connect( akamai: Optional[str] = None, extra_fp: Optional[Union[ExtraFingerprints, ExtraFpDict]] = None, default_headers: Optional[bool] = None, - default_encoding: Union[str, Callable[[bytes], str]] = "utf-8", quote: Union[str, Literal[False]] = "", http_version: Optional[CurlHttpVersion] = None, interface: Optional[str] = None, @@ -802,8 +801,6 @@ async def ws_connect( akamai: akamai string to impersonate. extra_fp: extra fingerprints options, in complement to ja3 and akamai strings. default_headers: whether to set default browser headers. - default_encoding: encoding for decoding response content if charset is not found - in headers. Defaults to "utf-8". Can be set to a callable for automatic detection. quote: Set characters to be quoted, i.e. percent-encoded. Default safe string is ``!#$%&'()*+,/:;=?@[]~``. If set to a sting, the character will be removed from the safe string, thus quoted. If set to False, the url will be kept as is, @@ -849,7 +846,7 @@ async def ws_connect( ) curl.setopt(CurlOpt.CONNECT_ONLY, 2) # https://curl.se/docs/websocket.html - self.loop.run_in_executor(None, curl.perform) + await self.loop.run_in_executor(None, curl.perform) return AsyncWebSocket(self, curl, autoclose=autoclose) async def request(