Upload files to "kronic/resolver"

This commit is contained in:
2026-11-25 20:28:57 -06:00
parent 82e1c788ab
commit 928521dd7c
5 changed files with 1088 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
from __future__ import annotations
from pydantic import BaseModel, Field
class FormatInfo(BaseModel):
id: str
name: str | None = None
protocol: str | None = None
ext: str | None = None
container: str | None = None
width: int | None = None
height: int | None = None
fps: float | None = None
vcodec: str | None = None
acodec: str | None = None
bitrate: float | None = None
filesize: int | None = None
audio_channels: int | None = None
language: str | None = None
video_only: bool = False
audio_only: bool = False
# Kronic backend consumes these immediately with ffmpeg.
# Signed URLs are short-lived; do not expose this API publicly.
direct_url: str
http_headers: dict[str, str] = Field(default_factory=dict)
class VideoInfo(BaseModel):
id: str
title: str
duration: float | None = None
channel: str | None = None
channel_id: str | None = None
thumbnail: str | None = None
formats: list[FormatInfo] = Field(default_factory=list)
class SearchItem(BaseModel):
id: str
title: str
duration: float | None = None
channel: str | None = None
channel_id: str | None = None
thumbnail: str | None = None
webpage_url: str | None = None
class SearchResponse(BaseModel):
items: list[SearchItem] = Field(default_factory=list)