randydev commited on
Commit
bb79b64
·
verified ·
1 Parent(s): 74c1727

Create youtube-v1.js

Browse files
Files changed (1) hide show
  1. lib/types/youtube-v1.js +26 -0
lib/types/youtube-v1.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { z } from "zod";
2
+
3
+ const YoutubeDownloaderArgsSchema = z.object({
4
+ 0: z.string().url(),
5
+ 1: z.enum(["id", "en", "es"]).optional()
6
+ });
7
+
8
+ const YoutubedlDataSchema = z.object({
9
+ quality: z.string(),
10
+ type: z.string(),
11
+ fileSizeH: z.string().nullable().optional(),
12
+ fileSize: z.number().nullable().optional(),
13
+ download: z.function().args().returns(z.promise(z.string().url()))
14
+ });
15
+
16
+ const YoutubedlSchema = z.object({
17
+ id: z.string(),
18
+ thumbnail: z.string().url(),
19
+ title: z.string(),
20
+ duration: z.number(),
21
+ video: z.record(z.string(), YoutubedlDataSchema).nullable().optional(),
22
+ audio: z.record(z.string(), YoutubedlDataSchema).nullable().optional(),
23
+ other: z.record(z.string(), YoutubedlDataSchema).nullable().optional()
24
+ });
25
+
26
+ export { YoutubeDownloaderArgsSchema, YoutubedlSchema };