calesthio/OpenMontage · warning · ValueError

Could not find download URL on Dareful page: {detail_url}

Error message

Could not find download URL on Dareful page: {detail_url}

What it means

ValueError raised by the Dareful adapter's download() when scraping the clip's detail page finds neither an anchor href matching its download-link selectors nor a <video><source src> element. Dareful has no public JSON API, so the adapter parses HTML; failure means the page layout changed, the clip is member-gated, or the page failed to render the expected elements.

Source

Thrown at tools/video/stock_sources/dareful.py:165

                href = a.get("href", "")
                text = (a.get_text(strip=True) or "").lower()
                if any(ext in href.lower() for ext in [".mp4", ".mov", ".webm"]):
                    download_url = href
                    break
                if "download" in text and href:
                    download_url = href
                    break

            # Check video elements
            if not download_url:
                for source in soup.select("video source[src], video[src]"):
                    src = source.get("src", "")
                    if src:
                        download_url = src
                        break

            if not download_url:
                raise ValueError(f"Could not find download URL on Dareful page: {detail_url}")

            if not download_url.startswith("http"):
                download_url = f"{_BASE_URL}{download_url}"

            return self._stream_download(download_url, out_path)

        except Exception as e:
            raise RuntimeError(f"Dareful download failed for {detail_url}: {e}") from e

    def _stream_download(self, url: str, out_path: Path) -> Path:
        import requests

        with requests.get(
            url, stream=True, timeout=180,
            headers={"User-Agent": "OpenMontage/1.0"},
        ) as r:
            r.raise_for_status()
            with open(out_path, "wb") as f:

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Open the detail_url in a browser and confirm a direct video link still exists on the page.
  2. If gated, fetch the file URL yourself while authenticated and stream it directly, bypassing the adapter's scrape.
  3. Fall back to another stock source (Pexels, Archive.org) for that clip — use get_source() on an alternate adapter.
  4. If Dareful's markup changed, update the CSS selectors in dareful.py to match the new page structure.

Example fix

# before
path = dareful.download(candidate, out)

# after
try:
    path = dareful.download(candidate, out)
except (ValueError, RuntimeError):
    path = get_source("pexels").download(alternate_candidate, out)
Defensive patterns

Strategy: fallback

Try / catch

try:
    path = dareful.download(candidate, out_path)
except (ValueError, RuntimeError) as e:
    logger.warning("dareful scrape failed: %s", e)
    path = alternate_source.download(alternate_candidate, out_path)

Prevention

When it happens

Trigger: Dareful redesigns their detail-page template; the clip requires login (download button only present for members); a Cloudflare/interstitial page is served instead of the real detail page; the detail_url itself 404s or redirects.

Common situations: Sites like Dareful changing markup without notice (classic scraper fragility); geo-blocks or bot detection returning alternate HTML; stale detail_url captured in an earlier search and expired since.

Related errors


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