From f8cdc969f33e848b3cf0626f6285f43e4eb20655 Mon Sep 17 00:00:00 2001 From: vvanglro Date: Tue, 30 Jul 2024 14:06:56 +0800 Subject: [PATCH] refactor(requests): standardize default browser variables to uppercase --- curl_cffi/requests/impersonate.py | 20 ++++++++++---------- curl_cffi/requests/session.py | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/curl_cffi/requests/impersonate.py b/curl_cffi/requests/impersonate.py index 27c473b..1a88b56 100644 --- a/curl_cffi/requests/impersonate.py +++ b/curl_cffi/requests/impersonate.py @@ -35,24 +35,24 @@ "chrome_android", ] -DefaultChrome = "chrome124" -DefaultEdge = "edge101" -DefaultSafari = "safari17_0" -DefaultSafariPhone = "safari17_2_ios" -DefaultChromePhone = "chrome99_android" +DEFAULT_CHROME = "chrome124" +DEFAULT_EDGE = "edge101" +DEFAULT_SAFARI = "safari17_0" +DEFAULT_SAFARI_IOS = "safari17_2_ios" +DEFAULT_CHROME_ANDROID = "chrome99_android" def normalize_browser_type(item): if item == "chrome": # noqa: SIM116 - return DefaultChrome + return DEFAULT_CHROME elif item == "edge": - return DefaultEdge + return DEFAULT_EDGE elif item == "safari": - return DefaultSafari + return DEFAULT_SAFARI elif item == "safari_ios": - return DefaultSafariPhone + return DEFAULT_SAFARI_IOS elif item == "chrome_android": - return DefaultChromePhone + return DEFAULT_CHROME_ANDROID else: return item diff --git a/curl_cffi/requests/session.py b/curl_cffi/requests/session.py index 3e7eacd..18f0e76 100644 --- a/curl_cffi/requests/session.py +++ b/curl_cffi/requests/session.py @@ -35,6 +35,7 @@ TLS_CIPHER_NAME_MAP, TLS_EC_CURVES_MAP, TLS_VERSION_MAP, + BrowserType, # noqa: F401 BrowserTypeLiteral, ExtraFingerprints, ExtraFpDict,