Skip to content

Commit

Permalink
refactor(requests): standardize default browser variables to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
vvanglro committed Jul 30, 2024
1 parent a03e448 commit f8cdc96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 10 additions & 10 deletions curl_cffi/requests/impersonate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions curl_cffi/requests/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
TLS_CIPHER_NAME_MAP,
TLS_EC_CURVES_MAP,
TLS_VERSION_MAP,
BrowserType, # noqa: F401
BrowserTypeLiteral,
ExtraFingerprints,
ExtraFpDict,
Expand Down

0 comments on commit f8cdc96

Please sign in to comment.