mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
feat(amazon): add marketplace locale mapping
This commit is contained in:
parent
e19c9b292f
commit
952aca3de5
1 changed files with 33 additions and 0 deletions
33
surfsense_backend/app/proprietary/platforms/amazon/locale.py
Normal file
33
surfsense_backend/app/proprietary/platforms/amazon/locale.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"""Marketplace locale helpers for Amazon fetch routing.
|
||||
|
||||
Only proxy countries verified against the configured DataImpulse plan are mapped
|
||||
here. Unmapped marketplaces fall back to the default proxy exit.
|
||||
"""
|
||||
|
||||
_MARKETPLACE_COUNTRY = {
|
||||
"com": "us",
|
||||
"co.uk": "gb",
|
||||
"de": "de",
|
||||
"fr": "fr",
|
||||
"it": "it",
|
||||
"es": "es",
|
||||
}
|
||||
|
||||
_MARKETPLACE_LANGUAGE = {
|
||||
"com": "en-US",
|
||||
"co.uk": "en-GB",
|
||||
"de": "de-DE",
|
||||
"fr": "fr-FR",
|
||||
"it": "it-IT",
|
||||
"es": "es-ES",
|
||||
}
|
||||
|
||||
|
||||
def proxy_country_for(marketplace: str | None) -> str | None:
|
||||
"""Return a confirmed proxy exit country for one Amazon marketplace."""
|
||||
return _MARKETPLACE_COUNTRY.get((marketplace or "").lower())
|
||||
|
||||
|
||||
def accept_language_for(marketplace: str | None) -> str:
|
||||
"""Return the browser language header that matches the marketplace UI."""
|
||||
return _MARKETPLACE_LANGUAGE.get((marketplace or "").lower(), "en-US")
|
||||
Loading…
Add table
Add a link
Reference in a new issue