Add playlist support to downloader API and frontend
Enhanced the downloader backend and frontend to support playlist URLs for video info and downloads. The API now returns structured playlist information, allows selecting specific videos for download, and returns a ZIP file for playlist downloads. Updated OpenAPI types, removed deprecated parameters (start_time, end_time, playlist_items), and improved Content Security Policy handling in nginx. Refactored frontend to handle playlist selection and updated generated API models accordingly.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
export type ApiDownloaderDownloadRetrieveParams = {
|
||||
/**
|
||||
* Video URL from YouTube, TikTok, Vimeo, etc. Must be a valid URL from a supported platform.
|
||||
* Video/Playlist URL from YouTube, TikTok, Vimeo, etc. Must be a valid URL from a supported platform.
|
||||
* @minLength 1
|
||||
*/
|
||||
url: string;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
export interface DownloadRequest {
|
||||
/** Video URL to download from supported platforms */
|
||||
/** Video/Playlist URL to download from supported platforms */
|
||||
url: string;
|
||||
/** Container format for the output file. Common formats: mp4 (H.264 + AAC, most compatible), mkv (flexible, lossless container), webm (VP9/AV1 + Opus), flv (legacy), mov (Apple-friendly), avi (older), ogg, m4a (audio only), mp3 (audio only). The extension will be validated by ffmpeg during conversion. */
|
||||
ext?: string;
|
||||
@@ -19,6 +19,11 @@ export interface DownloadRequest {
|
||||
* @nullable
|
||||
*/
|
||||
audio_quality?: number | null;
|
||||
/**
|
||||
* For playlists: specify which videos to download as array of numbers (e.g., [1,3,5]). If omitted, all videos are downloaded.
|
||||
* @nullable
|
||||
*/
|
||||
selected_videos?: number[] | null;
|
||||
/**
|
||||
* Language codes (e.g., 'en', 'cs', 'en,cs') or 'all' for all available subtitles
|
||||
* @nullable
|
||||
@@ -30,21 +35,6 @@ export interface DownloadRequest {
|
||||
embed_thumbnail?: boolean;
|
||||
/** Extract audio only, ignoring video quality settings */
|
||||
extract_audio?: boolean;
|
||||
/**
|
||||
* Start time for trimming (format: HH:MM:SS or seconds as integer)
|
||||
* @nullable
|
||||
*/
|
||||
start_time?: string | null;
|
||||
/**
|
||||
* End time for trimming (format: HH:MM:SS or seconds as integer)
|
||||
* @nullable
|
||||
*/
|
||||
end_time?: string | null;
|
||||
/**
|
||||
* Playlist items to download (e.g., '1-5,8,10' or '1,2,3')
|
||||
* @nullable
|
||||
*/
|
||||
playlist_items?: string | null;
|
||||
/**
|
||||
* Browser cookies in Netscape format for age-restricted content. Export from browser extensions like 'Get cookies.txt'
|
||||
* @nullable
|
||||
|
||||
@@ -80,6 +80,7 @@ export * from "./stateFdaEnum";
|
||||
export * from "./statusEnum";
|
||||
export * from "./trackingURL";
|
||||
export * from "./userRegistration";
|
||||
export * from "./videoInfo";
|
||||
export * from "./videoInfoResponse";
|
||||
export * from "./zasilkovnaPacket";
|
||||
export * from "./zasilkovnaPacketRead";
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/**
|
||||
* Generated by orval v7.17.0 🍺
|
||||
* Do not edit manually.
|
||||
* OpenAPI spec version: 0.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* * `WAITING_FOR_ORDERING_SHIPMENT` - cz#Čeká na objednání zásilkovny
|
||||
* `PENDING` - cz#Podáno
|
||||
* `SENDED` - cz#Odesláno
|
||||
* `ARRIVED` - cz#Doručeno
|
||||
* `CANCELED` - cz#Zrušeno
|
||||
* `RETURNING` - cz#Posláno zpátky
|
||||
* `RETURNED` - cz#Vráceno
|
||||
*/
|
||||
export type StateE15Enum = (typeof StateE15Enum)[keyof typeof StateE15Enum];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export const StateE15Enum = {
|
||||
WAITING_FOR_ORDERING_SHIPMENT: "WAITING_FOR_ORDERING_SHIPMENT",
|
||||
PENDING: "PENDING",
|
||||
SENDED: "SENDED",
|
||||
ARRIVED: "ARRIVED",
|
||||
CANCELED: "CANCELED",
|
||||
RETURNING: "RETURNING",
|
||||
RETURNED: "RETURNED",
|
||||
} as const;
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Generated by orval v7.17.0 🍺
|
||||
* Do not edit manually.
|
||||
* OpenAPI spec version: 0.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* * `ordered` - cz#Objednávka se připravuje
|
||||
* `shipped` - cz#Odesláno
|
||||
* `delivered` - cz#Doručeno
|
||||
* `ready_to_pickup` - cz#Připraveno k vyzvednutí
|
||||
*/
|
||||
export type StateFdaEnum = (typeof StateFdaEnum)[keyof typeof StateFdaEnum];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export const StateFdaEnum = {
|
||||
ordered: "ordered",
|
||||
shipped: "shipped",
|
||||
delivered: "delivered",
|
||||
ready_to_pickup: "ready_to_pickup",
|
||||
} as const;
|
||||
26
frontend/src/api/generated/public/models/videoInfo.ts
Normal file
26
frontend/src/api/generated/public/models/videoInfo.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Generated by orval v7.17.0 🍺
|
||||
* Do not edit manually.
|
||||
* OpenAPI spec version: 0.0.0
|
||||
*/
|
||||
|
||||
export interface VideoInfo {
|
||||
/** Video ID */
|
||||
id: string;
|
||||
/** Video title */
|
||||
title: string;
|
||||
/**
|
||||
* Video duration in seconds (null if unavailable)
|
||||
* @nullable
|
||||
*/
|
||||
duration: number | null;
|
||||
/**
|
||||
* Base64 encoded thumbnail image as data URL (e.g., data:image/jpeg;base64,...)
|
||||
* @nullable
|
||||
*/
|
||||
thumbnail: string | null;
|
||||
/** List of available video quality options (e.g., '1080p', '720p', '480p') */
|
||||
video_resolutions: string[];
|
||||
/** List of available audio format options */
|
||||
audio_resolutions: string[];
|
||||
}
|
||||
@@ -3,22 +3,21 @@
|
||||
* Do not edit manually.
|
||||
* OpenAPI spec version: 0.0.0
|
||||
*/
|
||||
import type { VideoInfo } from "./videoInfo";
|
||||
|
||||
export interface VideoInfoResponse {
|
||||
/** Video title */
|
||||
title: string;
|
||||
/** Whether the URL is a playlist */
|
||||
is_playlist: boolean;
|
||||
/**
|
||||
* Video duration in seconds (null if unavailable)
|
||||
* Playlist title (if applicable)
|
||||
* @nullable
|
||||
*/
|
||||
duration: number | null;
|
||||
playlist_title: string | null;
|
||||
/**
|
||||
* URL to video thumbnail image
|
||||
* Number of videos in playlist (if applicable)
|
||||
* @nullable
|
||||
*/
|
||||
thumbnail: string | null;
|
||||
/** List of available video quality options (e.g., '1080p', '720p', '480p') */
|
||||
video_resolutions: string[];
|
||||
/** List of available audio format options */
|
||||
audio_resolutions: string[];
|
||||
playlist_count: number | null;
|
||||
/** Array of video information (single video for individual URLs, multiple for playlists) */
|
||||
videos: VideoInfo[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user