xtekky/gpt4free · warning · RuntimeError

Failed to find any videos for the prompt.

Error message

Failed to find any videos for the prompt.

What it means

Raised as RuntimeError by the Video provider when RequestConfig.get_response(prompt, ...) returns a falsy value: the underlying video search found nothing (or failed silently) for the translated prompt. The prompt was valid but yielded no results.

Source

Thrown at g4f/Provider/needs_auth/Video.py:164

            raise ValueError(
                f"Model '{model}' is not supported by {cls.__name__}. Supported models: {cls.models}"
            )
        yield ProviderInfo(**cls.get_dict(), model=model)
        prompt = (
            format_media_prompt(messages, prompt)
            .encode()[:100]
            .decode("utf-8", "ignore")
            .strip()
        )
        if not prompt:
            raise ValueError("Prompt cannot be empty.")
        prompt = await RequestConfig.translate_prompt(prompt)
        response = await RequestConfig.get_response(prompt, model == "search")
        if response:
            yield Reasoning(label=f"Found {len(response.urls)} Video(s)", status="")
            yield response
            return
        raise RuntimeError("Failed to find any videos for the prompt.")

View on GitHub (pinned to 973504e177)

Solutions

  1. Retry with a simpler, more common-worded prompt
  2. Catch RuntimeError and fall back to another video provider or skip the enhancement
  3. Retry after a delay if the search backend may be temporarily unavailable

Example fix

# before
response = client.chat.completions.create(model='search', messages=msgs, provider=g4f.Provider.Video)

# after
try:
    response = client.chat.completions.create(model='search', messages=msgs, provider=g4f.Provider.Video)
except RuntimeError:
    response = None  # degrade gracefully, skip video enrichment
Defensive patterns

Strategy: fallback

Try / catch

try:
    result = ...create(..., provider=g4f.Provider.Video)
except RuntimeError as e:
    if 'Failed to find any videos' in str(e):
        result = None  # video enrichment is optional; continue without it
    else:
        raise

Prevention

When it happens

Trigger: Searching for a video whose terms match nothing in the search backend, or the search request failing and returning None rather than raising.

Common situations: Overly specific/nonsense prompts, search backend temporarily down, prompts that translate (RequestConfig.translate_prompt) into terms with no matches.

Related errors


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/d3c977b3af14a4f8. Report an issue: GitHub.