trust env when fetching details and listings. this allows setting proxy env vars. I use this in conjunction with a tor proxy to avoid ip-bans from rightmove

This commit is contained in:
Viktor Barzin 2025-06-01 00:12:31 +00:00
parent 0b9d50af47
commit 24bf44caf9
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863

View file

@ -39,7 +39,7 @@ async def detail_query(detail_id: int):
"appVersion": "3.70.0",
}
url = f"https://api.rightmove.co.uk/api/property/{detail_id}"
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(trust_env=True) as session:
async with session.get(url, params=params, headers=headers) as response:
if response.status != 200:
raise Exception(
@ -106,7 +106,7 @@ async def listing_query(
"Connection": "keep-alive",
}
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(trust_env=True) as session:
async with session.get(
"https://api.rightmove.co.uk/api/property-listing",
params=params,