feat: validate tiktok scrape and comments URLs

This commit is contained in:
CREDO23 2026-07-23 18:52:39 +02:00
parent 96f05991eb
commit a5ccd40387
2 changed files with 4 additions and 2 deletions

View file

@ -10,6 +10,7 @@ from __future__ import annotations
from pydantic import BaseModel, Field
from app.capabilities.core.validation import HttpUrlStr
from app.capabilities.tiktok.scrape.schemas import (
MAX_TIKTOK_ITEMS,
MAX_TIKTOK_SOURCES,
@ -18,7 +19,7 @@ from app.proprietary.platforms.tiktok import CommentItem
class CommentsInput(BaseModel):
video_urls: list[str] = Field(
video_urls: list[HttpUrlStr] = Field(
min_length=1,
max_length=MAX_TIKTOK_SOURCES,
description="TikTok video URLs (/@<user>/video/<id>) to pull comments from.",

View file

@ -12,6 +12,7 @@ from __future__ import annotations
from pydantic import BaseModel, Field, model_validator
from app.capabilities.core.validation import HttpUrlStr
from app.proprietary.platforms.tiktok import TikTokVideoItem
MAX_TIKTOK_SOURCES = 20
@ -22,7 +23,7 @@ MAX_TIKTOK_ITEMS = 100
class ScrapeInput(BaseModel):
urls: list[str] = Field(
urls: list[HttpUrlStr] = Field(
default_factory=list,
max_length=MAX_TIKTOK_SOURCES,
description=(