ryu-js / lib /types /youtube-v1.js
randydev's picture
Create youtube-v1.js
bb79b64 verified
raw
history blame
832 Bytes
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 };