diegosouzapw/OmniRoute · error · Error

Failed to extract CSRF nonce from veoaifree.com

Error message

Failed to extract CSRF nonce from veoaifree.com

What it means

fetchNonce downloaded the veoaifree.com page but the regex /nonce":"([a-f0-9]+)"/ found no match, so the CSRF nonce required for subsequent AJAX calls could not be extracted. Typically caused by a page layout/obfuscation change, a bot-check interstitial, or an error page.

Solutions

  1. Update the extraction regex when the site changes its nonce embedding
  2. Detect challenge/interstitial pages and retry after solving or waiting
  3. Log a snippet of the HTML to diagnose extraction failures
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at open-sse/executors/veoaifree-web.ts:221 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/0a3340f397adcbf5. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/veoaifree-web.ts:221

}

async function fetchSession(
  context: VeoSessionContext,
  url: string,
  init: RequestInit = {}
): Promise<Response> {
  const response = await fetchWithTimeout(url, init, context.signal);
  updateSessionCookies(context, response);
  return response;
}

async function fetchNonce(context: VeoSessionContext): Promise<string> {
  const res = await fetchSession(context, BASE_URL, {
    headers: buildRequestHeaders(context, { includeCookie: false }),
  });
  const html = await res.text();
  const match = html.match(/nonce":"([a-f0-9]+)"/);
  if (!match) throw new Error("Failed to extract CSRF nonce from veoaifree.com");
  return match[1];
}

async function postAjax(
  context: VeoSessionContext,
  nonce: string,
  params: Record<string, string>
): Promise<string> {
  const body = new URLSearchParams({ action: "veo_video_generator", nonce, ...params });
  const res = await fetchSession(context, AJAX_URL, {
    method: "POST",
    headers: buildRequestHeaders(context, {
      contentType: "application/x-www-form-urlencoded",
      includeOrigin: true,
    }),
    body: body.toString(),
  });
  return res.text();

View on GitHub (pinned to a179ffed5b)