Create youtubedl-v1.js
Browse files- lib/types/youtubedl-v1.js +58 -0
lib/types/youtubedl-v1.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { z } from 'zod';
|
2 |
+
|
3 |
+
const LinkItemSchema = z.object({
|
4 |
+
size: z.string(),
|
5 |
+
f: z.string(),
|
6 |
+
q: z.string(),
|
7 |
+
q_text: z.string(),
|
8 |
+
k: z.string(),
|
9 |
+
});
|
10 |
+
|
11 |
+
const LinksSchema = z.object({
|
12 |
+
mp4: z.record(LinkItemSchema),
|
13 |
+
mp3: z.record(LinkItemSchema),
|
14 |
+
other: z.record(LinkItemSchema),
|
15 |
+
});
|
16 |
+
|
17 |
+
const RelatedContentSchema = z.object({
|
18 |
+
v: z.string(),
|
19 |
+
t: z.string(),
|
20 |
+
});
|
21 |
+
|
22 |
+
const RelatedVideosSchema = z.object({
|
23 |
+
title: z.string(),
|
24 |
+
contents: z.array(RelatedContentSchema),
|
25 |
+
});
|
26 |
+
|
27 |
+
const YoutubedlResponseSchema = z.object({
|
28 |
+
status: z.string(),
|
29 |
+
mess: z.string(),
|
30 |
+
page: z.string(),
|
31 |
+
vid: z.string(),
|
32 |
+
extractor: z.string(),
|
33 |
+
title: z.string(),
|
34 |
+
t: z.number(),
|
35 |
+
a: z.string(),
|
36 |
+
links: LinksSchema,
|
37 |
+
related: z.array(RelatedVideosSchema),
|
38 |
+
});
|
39 |
+
|
40 |
+
const ConvertResponseSchema = z.object({
|
41 |
+
status: z.string(),
|
42 |
+
mess: z.string(),
|
43 |
+
c_status: z.string(),
|
44 |
+
vid: z.string(),
|
45 |
+
title: z.string(),
|
46 |
+
ftype: z.string(),
|
47 |
+
fquality: z.string(),
|
48 |
+
dlink: z.string().url(),
|
49 |
+
});
|
50 |
+
|
51 |
+
export {
|
52 |
+
LinkItemSchema,
|
53 |
+
LinksSchema,
|
54 |
+
RelatedContentSchema,
|
55 |
+
RelatedVideosSchema,
|
56 |
+
YoutubedlResponseSchema,
|
57 |
+
ConvertResponseSchema
|
58 |
+
};
|