File size: 832 Bytes
bb79b64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { z } from "zod";

const YoutubeDownloaderArgsSchema = z.object({
    0: z.string().url(),
    1: z.enum(["id", "en", "es"]).optional()
});

const YoutubedlDataSchema = z.object({
    quality: z.string(),
    type: z.string(),
    fileSizeH: z.string().nullable().optional(),
    fileSize: z.number().nullable().optional(),
    download: z.function().args().returns(z.promise(z.string().url()))
});

const YoutubedlSchema = z.object({
    id: z.string(),
    thumbnail: z.string().url(),
    title: z.string(),
    duration: z.number(),
    video: z.record(z.string(), YoutubedlDataSchema).nullable().optional(),
    audio: z.record(z.string(), YoutubedlDataSchema).nullable().optional(),
    other: z.record(z.string(), YoutubedlDataSchema).nullable().optional()
});

export { YoutubeDownloaderArgsSchema, YoutubedlSchema };