youtube-transcript-api/schemas/transcript.py

24 lines
431 B
Python

from pydantic import BaseModel
from typing import List
from typing import List, Literal
class CaptionSegment(BaseModel):
start: float
end: float
text: str
class VideoMetadata(BaseModel):
id: str
title: str
channel: str
duration: int
url: str
class TranscriptResponse(BaseModel):
video: VideoMetadata
captions: List[CaptionSegment]
language: str
source: Literal["human", "auto"]