Fix slower Zillow unit photo discovery path

This commit is contained in:
2026-03-28 02:28:30 -05:00
parent 7690dc259b
commit 8fe451e8d0
11 changed files with 167 additions and 49 deletions

View File

@@ -32,7 +32,7 @@ async function getAnnouncedPhotoCount(page) {
});
}
export async function extractHarPhotos(rawUrl) {
export async function extractHarPhotos(rawUrl, options = {}) {
const requestedUrl = parseTarget(rawUrl);
const { context, page } = await createPageSession({ headless: process.env.HEADLESS !== "false" });
const closeContext = async () => {
@@ -78,6 +78,7 @@ export async function extractHarPhotos(rawUrl) {
};
},
{
timeoutMs: Number(options.timeoutMs || 0) || undefined,
onTimeout: closeContext
}
);