13 lines
566 B
Python
13 lines
566 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional, Dict, Any
|
|
|
|
|
|
class URLValidationRequest(BaseModel):
|
|
url: str = Field(..., description="YouTube URL to validate", min_length=1)
|
|
|
|
|
|
class URLValidationResponse(BaseModel):
|
|
is_valid: bool = Field(..., description="Whether the URL is valid")
|
|
video_id: Optional[str] = Field(None, description="Extracted video ID if valid")
|
|
video_url: Optional[str] = Field(None, description="Normalized YouTube URL")
|
|
error: Optional[Dict[str, Any]] = Field(None, description="Error details if invalid") |