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:
parent
0b9d50af47
commit
24bf44caf9
1 changed files with 2 additions and 2 deletions
|
|
@ -39,7 +39,7 @@ async def detail_query(detail_id: int):
|
||||||
"appVersion": "3.70.0",
|
"appVersion": "3.70.0",
|
||||||
}
|
}
|
||||||
url = f"https://api.rightmove.co.uk/api/property/{detail_id}"
|
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:
|
async with session.get(url, params=params, headers=headers) as response:
|
||||||
if response.status != 200:
|
if response.status != 200:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
|
|
@ -106,7 +106,7 @@ async def listing_query(
|
||||||
"Connection": "keep-alive",
|
"Connection": "keep-alive",
|
||||||
}
|
}
|
||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession(trust_env=True) as session:
|
||||||
async with session.get(
|
async with session.get(
|
||||||
"https://api.rightmove.co.uk/api/property-listing",
|
"https://api.rightmove.co.uk/api/property-listing",
|
||||||
params=params,
|
params=params,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue