calesthio/OpenMontage · error · ValueError

Candidate {candidate.clip_id} has no download_url

Error message

Candidate {candidate.clip_id} has no download_url

What it means

Error "Candidate {candidate.clip_id} has no download_url" thrown in calesthio/OpenMontage.

Source

Thrown at tools/video/stock_sources/pexels.py:82

        out: list[Candidate] = []
        if kind in ("video", "any"):
            out.extend(self._search_videos(query, filters))
        if kind in ("image", "any"):
            out.extend(self._search_images(query, filters))
        return out

    def download(self, candidate: Candidate, out_path: Path) -> Path:
        """Stream the candidate's file to `out_path`.

        Creates parent directories as needed. Uses streamed chunks so
        large 1080p clips don't blow RAM. No caching — the corpus
        builder is responsible for deciding whether to call this at
        all.
        """
        import requests  # lazy — avoid pulling requests at import time

        if not candidate.download_url:
            raise ValueError(
                f"Candidate {candidate.clip_id} has no download_url"
            )

        out_path = Path(out_path)
        out_path.parent.mkdir(parents=True, exist_ok=True)

        with requests.get(
            candidate.download_url, stream=True, timeout=120
        ) as r:
            r.raise_for_status()
            with open(out_path, "wb") as f:
                for chunk in r.iter_content(chunk_size=1 << 16):
                    if chunk:
                        f.write(chunk)
        return out_path

    # ------------------------------------------------------------------
    # Internals

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Skip this candidate and pick another result that includes a download_url.
  2. Re-query the Pexels API; video file links are normally present, so an empty one indicates a partial API response.

When it happens

Trigger: A Pexels stock candidate is selected for download but has no download_url in its metadata.

Common situations: See trigger scenarios.


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/750744e9735846cd. Report an issue: GitHub.