Skip to content

World's first open-source, agentic video production system. 12 production pipelines, 100+ tools, 700+ agent skill and production-knowledge files. Turn your AI coding assistant into a full video production studio.

556 B
Raw Blame
"""Callback validation helpers for Kling official providers."""

from __future__ import annotations

from urllib.parse import urlparse


def validate_callback_url(callback_url: str | None) -> str | None:
    """Return a normalized callback URL or raise for obviously invalid input."""

    if not callback_url:
        return None
    value = str(callback_url).strip()
    parsed = urlparse(value)
    if parsed.scheme not in {"http", "https"} or not parsed.netloc:
        raise ValueError("callback_url must be an absolute http(s) URL")
    return value