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

@@ -105,7 +105,7 @@ async function collectZillowStructuredPhotoCandidates(page) {
return extractZillowStructuredPhotoCandidatesFromNextDataScript(scriptText || "");
}
export async function extractZillowPhotos(rawUrl) {
export async function extractZillowPhotos(rawUrl, options = {}) {
const requestedUrl = parseTarget(rawUrl);
const { context, page } = await createPageSession({ headless: process.env.HEADLESS !== "false" });
const closeContext = async () => {
@@ -177,6 +177,7 @@ export async function extractZillowPhotos(rawUrl) {
};
},
{
timeoutMs: Number(options.timeoutMs || 0) || undefined,
onTimeout: closeContext
}
);