Add animation keyframes for grid and shimmer effects, implement mouse position tracking for dynamic background, and create direct download API for video/audio files. Update types for download requests and responses.
This commit is contained in:
24
lib/types.ts
24
lib/types.ts
@@ -9,10 +9,34 @@ export interface DownloadRequest {
|
||||
formatType: FormatType;
|
||||
}
|
||||
|
||||
export interface DirectDownloadRequest {
|
||||
id: string;
|
||||
format: VideoFormat | AudioFormat;
|
||||
formatType: FormatType;
|
||||
}
|
||||
|
||||
export interface DownloadResponse {
|
||||
|
||||
success: boolean;
|
||||
downloadUrl?: string;
|
||||
filename?: string;
|
||||
filePath?: string;
|
||||
error?: string;
|
||||
videoInfo?: VideoInfo;
|
||||
}
|
||||
|
||||
|
||||
export interface DirectDownloadRequest {
|
||||
videoId: string;
|
||||
format: VideoFormat | AudioFormat;
|
||||
formatType: FormatType;
|
||||
}
|
||||
|
||||
export interface DownloadResponse {
|
||||
success: boolean;
|
||||
downloadUrl?: string;
|
||||
filename?: string;
|
||||
filePath?: string;
|
||||
error?: string;
|
||||
videoInfo?: VideoInfo;
|
||||
}
|
||||
|
||||
@@ -28,3 +28,8 @@ export function extractYouTubeId(url: string): string | null {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Validate a bare YouTube video ID (11 chars, URL-safe)
|
||||
export function isValidYouTubeId(id: string): boolean {
|
||||
return /^[A-Za-z0-9_-]{11}$/.test(id);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { exec } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
import { writeFile, readFile, unlink, mkdir, copyFile } from 'fs/promises';
|
||||
import { readFile, unlink, mkdir, copyFile } from 'fs/promises';
|
||||
import { existsSync } from 'fs';
|
||||
import path from 'path';
|
||||
import type { VideoInfo, FormatOption, DownloadRequest, DownloadResponse } from './types';
|
||||
|
||||
Reference in New Issue
Block a user