@mks2508/bundlp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +495 -0
  2. package/dist/core/extractor.d.ts +30 -0
  3. package/dist/core/extractor.d.ts.map +1 -0
  4. package/dist/http/client.d.ts +50 -0
  5. package/dist/http/client.d.ts.map +1 -0
  6. package/dist/http/retry.d.ts +22 -0
  7. package/dist/http/retry.d.ts.map +1 -0
  8. package/dist/index.d.ts +20 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +19021 -0
  11. package/dist/innertube/client.d.ts +62 -0
  12. package/dist/innertube/client.d.ts.map +1 -0
  13. package/dist/player/ast/analyzer.d.ts +16 -0
  14. package/dist/player/ast/analyzer.d.ts.map +1 -0
  15. package/dist/player/ast/extractor.d.ts +35 -0
  16. package/dist/player/ast/extractor.d.ts.map +1 -0
  17. package/dist/player/ast/matchers.d.ts +40 -0
  18. package/dist/player/ast/matchers.d.ts.map +1 -0
  19. package/dist/player/cache.d.ts +60 -0
  20. package/dist/player/cache.d.ts.map +1 -0
  21. package/dist/player/player.d.ts +49 -0
  22. package/dist/player/player.d.ts.map +1 -0
  23. package/dist/po-token/botguard/challenge.d.ts +22 -0
  24. package/dist/po-token/botguard/challenge.d.ts.map +1 -0
  25. package/dist/po-token/botguard/client.d.ts +25 -0
  26. package/dist/po-token/botguard/client.d.ts.map +1 -0
  27. package/dist/po-token/cache/token-cache.d.ts +24 -0
  28. package/dist/po-token/cache/token-cache.d.ts.map +1 -0
  29. package/dist/po-token/index.d.ts +14 -0
  30. package/dist/po-token/index.d.ts.map +1 -0
  31. package/dist/po-token/manager.d.ts +34 -0
  32. package/dist/po-token/manager.d.ts.map +1 -0
  33. package/dist/po-token/minter/web-minter.d.ts +20 -0
  34. package/dist/po-token/minter/web-minter.d.ts.map +1 -0
  35. package/dist/po-token/policies.d.ts +18 -0
  36. package/dist/po-token/policies.d.ts.map +1 -0
  37. package/dist/po-token/providers/local.provider.d.ts +26 -0
  38. package/dist/po-token/providers/local.provider.d.ts.map +1 -0
  39. package/dist/po-token/providers/provider.interface.d.ts +15 -0
  40. package/dist/po-token/providers/provider.interface.d.ts.map +1 -0
  41. package/dist/po-token/types.d.ts +160 -0
  42. package/dist/po-token/types.d.ts.map +1 -0
  43. package/dist/result/index.d.ts +6 -0
  44. package/dist/result/index.d.ts.map +1 -0
  45. package/dist/result/result.types.d.ts +14 -0
  46. package/dist/result/result.types.d.ts.map +1 -0
  47. package/dist/result/result.utils.d.ts +32 -0
  48. package/dist/result/result.utils.d.ts.map +1 -0
  49. package/dist/streaming/dash/parser.d.ts +37 -0
  50. package/dist/streaming/dash/parser.d.ts.map +1 -0
  51. package/dist/streaming/dash/segments.d.ts +58 -0
  52. package/dist/streaming/dash/segments.d.ts.map +1 -0
  53. package/dist/streaming/decipher.d.ts +24 -0
  54. package/dist/streaming/decipher.d.ts.map +1 -0
  55. package/dist/streaming/drm.d.ts +26 -0
  56. package/dist/streaming/drm.d.ts.map +1 -0
  57. package/dist/streaming/formats.d.ts +20 -0
  58. package/dist/streaming/formats.d.ts.map +1 -0
  59. package/dist/streaming/hls/parser.d.ts +10 -0
  60. package/dist/streaming/hls/parser.d.ts.map +1 -0
  61. package/dist/streaming/hls/segments.d.ts +37 -0
  62. package/dist/streaming/hls/segments.d.ts.map +1 -0
  63. package/dist/streaming/processor.d.ts +20 -0
  64. package/dist/streaming/processor.d.ts.map +1 -0
  65. package/dist/types/error.types.d.ts +12 -0
  66. package/dist/types/error.types.d.ts.map +1 -0
  67. package/dist/types/index.d.ts +8 -0
  68. package/dist/types/index.d.ts.map +1 -0
  69. package/dist/types/innertube.types.d.ts +155 -0
  70. package/dist/types/innertube.types.d.ts.map +1 -0
  71. package/dist/types/player.types.d.ts +30 -0
  72. package/dist/types/player.types.d.ts.map +1 -0
  73. package/dist/types/video.types.d.ts +112 -0
  74. package/dist/types/video.types.d.ts.map +1 -0
  75. package/dist/utils/constants.d.ts +129 -0
  76. package/dist/utils/constants.d.ts.map +1 -0
  77. package/dist/utils/m3u8.d.ts +31 -0
  78. package/dist/utils/m3u8.d.ts.map +1 -0
  79. package/dist/utils/xml.d.ts +41 -0
  80. package/dist/utils/xml.d.ts.map +1 -0
  81. package/dist/validation/schemas.d.ts +290 -0
  82. package/dist/validation/schemas.d.ts.map +1 -0
  83. package/package.json +72 -0
@@ -0,0 +1,290 @@
1
+ /**
2
+ * Schema for playability status returned by InnerTube API.
3
+ */
4
+ export declare const PlayabilityStatusSchema: import("arktype/internal/variants/object.ts").ObjectType<{
5
+ status: "LOGIN_REQUIRED" | "OK" | "UNPLAYABLE" | "AGE_CHECK_REQUIRED" | "ERROR";
6
+ reason?: string | undefined;
7
+ playableInEmbed?: boolean | undefined;
8
+ liveStreamability?: unknown;
9
+ }, {}>;
10
+ /**
11
+ * Schema for thumbnail objects.
12
+ */
13
+ export declare const ThumbnailSchema: import("arktype/internal/variants/object.ts").ObjectType<{
14
+ url: string;
15
+ width: number;
16
+ height: number;
17
+ }, {}>;
18
+ /**
19
+ * Schema for video details from InnerTube response.
20
+ * Some fields are optional as TV and other clients may omit them.
21
+ */
22
+ export declare const VideoDetailsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
23
+ videoId: string;
24
+ lengthSeconds: string;
25
+ channelId: string;
26
+ isLiveContent: boolean;
27
+ title?: string | undefined;
28
+ shortDescription?: string | undefined;
29
+ thumbnail?: {
30
+ thumbnails: {
31
+ url: string;
32
+ width: number;
33
+ height: number;
34
+ }[];
35
+ } | undefined;
36
+ viewCount?: string | undefined;
37
+ author?: string | undefined;
38
+ isPrivate?: boolean | undefined;
39
+ keywords?: string[] | undefined;
40
+ }, {}>;
41
+ /**
42
+ * Schema for raw format objects from streaming data.
43
+ */
44
+ export declare const RawFormatSchema: import("arktype/internal/variants/object.ts").ObjectType<{
45
+ itag: number;
46
+ mimeType: string;
47
+ bitrate: number;
48
+ quality: string;
49
+ url?: string | undefined;
50
+ signatureCipher?: string | undefined;
51
+ cipher?: string | undefined;
52
+ width?: number | undefined;
53
+ height?: number | undefined;
54
+ fps?: number | undefined;
55
+ qualityLabel?: string | undefined;
56
+ audioQuality?: string | undefined;
57
+ audioSampleRate?: string | undefined;
58
+ audioChannels?: number | undefined;
59
+ contentLength?: string | undefined;
60
+ approxDurationMs?: string | undefined;
61
+ initRange?: {
62
+ start: string;
63
+ end: string;
64
+ } | undefined;
65
+ indexRange?: {
66
+ start: string;
67
+ end: string;
68
+ } | undefined;
69
+ lastModified?: string | undefined;
70
+ drmFamilies?: string[] | undefined;
71
+ }, {}>;
72
+ /**
73
+ * Schema for streaming data section of player response.
74
+ */
75
+ export declare const StreamingDataSchema: import("arktype/internal/variants/object.ts").ObjectType<{
76
+ expiresInSeconds: string;
77
+ formats?: {
78
+ itag: number;
79
+ mimeType: string;
80
+ bitrate: number;
81
+ quality: string;
82
+ url?: string | undefined;
83
+ signatureCipher?: string | undefined;
84
+ cipher?: string | undefined;
85
+ width?: number | undefined;
86
+ height?: number | undefined;
87
+ fps?: number | undefined;
88
+ qualityLabel?: string | undefined;
89
+ audioQuality?: string | undefined;
90
+ audioSampleRate?: string | undefined;
91
+ audioChannels?: number | undefined;
92
+ contentLength?: string | undefined;
93
+ approxDurationMs?: string | undefined;
94
+ initRange?: {
95
+ start: string;
96
+ end: string;
97
+ } | undefined;
98
+ indexRange?: {
99
+ start: string;
100
+ end: string;
101
+ } | undefined;
102
+ lastModified?: string | undefined;
103
+ drmFamilies?: string[] | undefined;
104
+ }[] | undefined;
105
+ adaptiveFormats?: {
106
+ itag: number;
107
+ mimeType: string;
108
+ bitrate: number;
109
+ quality: string;
110
+ url?: string | undefined;
111
+ signatureCipher?: string | undefined;
112
+ cipher?: string | undefined;
113
+ width?: number | undefined;
114
+ height?: number | undefined;
115
+ fps?: number | undefined;
116
+ qualityLabel?: string | undefined;
117
+ audioQuality?: string | undefined;
118
+ audioSampleRate?: string | undefined;
119
+ audioChannels?: number | undefined;
120
+ contentLength?: string | undefined;
121
+ approxDurationMs?: string | undefined;
122
+ initRange?: {
123
+ start: string;
124
+ end: string;
125
+ } | undefined;
126
+ indexRange?: {
127
+ start: string;
128
+ end: string;
129
+ } | undefined;
130
+ lastModified?: string | undefined;
131
+ drmFamilies?: string[] | undefined;
132
+ }[] | undefined;
133
+ hlsManifestUrl?: string | undefined;
134
+ dashManifestUrl?: string | undefined;
135
+ }, {}>;
136
+ /**
137
+ * Schema for caption track information.
138
+ * Note: name can be either { simpleText } or { runs } format.
139
+ */
140
+ export declare const CaptionTrackSchema: import("arktype/internal/variants/object.ts").ObjectType<{
141
+ baseUrl: string;
142
+ languageCode: string;
143
+ name?: unknown;
144
+ kind?: string | undefined;
145
+ isTranslatable?: boolean | undefined;
146
+ }, {}>;
147
+ /**
148
+ * Schema for captions data section.
149
+ */
150
+ export declare const CaptionsDataSchema: import("arktype/internal/variants/object.ts").ObjectType<{
151
+ playerCaptionsTracklistRenderer?: {
152
+ captionTracks?: {
153
+ baseUrl: string;
154
+ languageCode: string;
155
+ name?: unknown;
156
+ kind?: string | undefined;
157
+ isTranslatable?: boolean | undefined;
158
+ }[] | undefined;
159
+ } | undefined;
160
+ }, {}>;
161
+ /**
162
+ * Schema for microformat data section.
163
+ */
164
+ export declare const MicroformatDataSchema: import("arktype/internal/variants/object.ts").ObjectType<{
165
+ playerMicroformatRenderer?: {
166
+ uploadDate?: string | undefined;
167
+ publishDate?: string | undefined;
168
+ category?: string | undefined;
169
+ isFamilySafe?: boolean | undefined;
170
+ lengthSeconds?: string | undefined;
171
+ } | undefined;
172
+ }, {}>;
173
+ /**
174
+ * Schema for the complete InnerTube player response.
175
+ */
176
+ export declare const PlayerResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
177
+ playabilityStatus: {
178
+ status: "LOGIN_REQUIRED" | "OK" | "UNPLAYABLE" | "AGE_CHECK_REQUIRED" | "ERROR";
179
+ reason?: string | undefined;
180
+ playableInEmbed?: boolean | undefined;
181
+ liveStreamability?: unknown;
182
+ };
183
+ videoDetails?: {
184
+ videoId: string;
185
+ lengthSeconds: string;
186
+ channelId: string;
187
+ isLiveContent: boolean;
188
+ title?: string | undefined;
189
+ shortDescription?: string | undefined;
190
+ thumbnail?: {
191
+ thumbnails: {
192
+ url: string;
193
+ width: number;
194
+ height: number;
195
+ }[];
196
+ } | undefined;
197
+ viewCount?: string | undefined;
198
+ author?: string | undefined;
199
+ isPrivate?: boolean | undefined;
200
+ keywords?: string[] | undefined;
201
+ } | undefined;
202
+ streamingData?: {
203
+ expiresInSeconds: string;
204
+ formats?: {
205
+ itag: number;
206
+ mimeType: string;
207
+ bitrate: number;
208
+ quality: string;
209
+ url?: string | undefined;
210
+ signatureCipher?: string | undefined;
211
+ cipher?: string | undefined;
212
+ width?: number | undefined;
213
+ height?: number | undefined;
214
+ fps?: number | undefined;
215
+ qualityLabel?: string | undefined;
216
+ audioQuality?: string | undefined;
217
+ audioSampleRate?: string | undefined;
218
+ audioChannels?: number | undefined;
219
+ contentLength?: string | undefined;
220
+ approxDurationMs?: string | undefined;
221
+ initRange?: {
222
+ start: string;
223
+ end: string;
224
+ } | undefined;
225
+ indexRange?: {
226
+ start: string;
227
+ end: string;
228
+ } | undefined;
229
+ lastModified?: string | undefined;
230
+ drmFamilies?: string[] | undefined;
231
+ }[] | undefined;
232
+ adaptiveFormats?: {
233
+ itag: number;
234
+ mimeType: string;
235
+ bitrate: number;
236
+ quality: string;
237
+ url?: string | undefined;
238
+ signatureCipher?: string | undefined;
239
+ cipher?: string | undefined;
240
+ width?: number | undefined;
241
+ height?: number | undefined;
242
+ fps?: number | undefined;
243
+ qualityLabel?: string | undefined;
244
+ audioQuality?: string | undefined;
245
+ audioSampleRate?: string | undefined;
246
+ audioChannels?: number | undefined;
247
+ contentLength?: string | undefined;
248
+ approxDurationMs?: string | undefined;
249
+ initRange?: {
250
+ start: string;
251
+ end: string;
252
+ } | undefined;
253
+ indexRange?: {
254
+ start: string;
255
+ end: string;
256
+ } | undefined;
257
+ lastModified?: string | undefined;
258
+ drmFamilies?: string[] | undefined;
259
+ }[] | undefined;
260
+ hlsManifestUrl?: string | undefined;
261
+ dashManifestUrl?: string | undefined;
262
+ } | undefined;
263
+ captions?: {
264
+ playerCaptionsTracklistRenderer?: {
265
+ captionTracks?: {
266
+ baseUrl: string;
267
+ languageCode: string;
268
+ name?: unknown;
269
+ kind?: string | undefined;
270
+ isTranslatable?: boolean | undefined;
271
+ }[] | undefined;
272
+ } | undefined;
273
+ } | undefined;
274
+ microformat?: {
275
+ playerMicroformatRenderer?: {
276
+ uploadDate?: string | undefined;
277
+ publishDate?: string | undefined;
278
+ category?: string | undefined;
279
+ isFamilySafe?: boolean | undefined;
280
+ lengthSeconds?: string | undefined;
281
+ } | undefined;
282
+ } | undefined;
283
+ storyboards?: unknown;
284
+ }, {}>;
285
+ export type PlayerResponse = typeof PlayerResponseSchema.infer;
286
+ export type StreamingData = typeof StreamingDataSchema.infer;
287
+ export type RawFormat = typeof RawFormatSchema.infer;
288
+ export type VideoDetails = typeof VideoDetailsSchema.infer;
289
+ export type PlayabilityStatus = typeof PlayabilityStatusSchema.infer;
290
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/validation/schemas.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;MAKlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;MAI1B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;MAc7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqB1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAM9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;MAM7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;MAI7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;MAQhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAO/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,KAAK,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,mBAAmB,CAAC,KAAK,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,OAAO,eAAe,CAAC,KAAK,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,KAAK,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,KAAK,CAAC"}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@mks2508/bundlp",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "Bun-native YouTube video/music resolver library",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "bun build ./src/index.ts --outdir ./dist --target bun",
22
+ "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
23
+ "dev": "bun --watch src/index.ts",
24
+ "test": "bun test",
25
+ "test:unit": "bun test tests/unit",
26
+ "test:integration": "bun test tests/integration",
27
+ "test:e2e": "bun test tests/e2e",
28
+ "test:watch": "bun test --watch",
29
+ "test:coverage": "bun test --coverage",
30
+ "lint": "bunx @biomejs/biome check src/",
31
+ "lint:fix": "bunx @biomejs/biome check --write src/",
32
+ "clean": "rm -rf dist",
33
+ "cli": "bun cli/index.ts"
34
+ },
35
+ "dependencies": {
36
+ "arktype": "^2.0.0",
37
+ "boxen": "^8.0.1",
38
+ "bundlp": "../bundlp",
39
+ "chalk": "^5.6.2",
40
+ "cli-table3": "^0.6.5",
41
+ "commander": "^14.0.2",
42
+ "figures": "^6.1.0",
43
+ "jsdom": "^27.4.0",
44
+ "meriyah": "^6.1.4",
45
+ "ora": "^9.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/bun": "latest",
49
+ "@types/jsdom": "^27.0.0",
50
+ "happy-dom": "^20.0.11",
51
+ "linkedom": "^0.18.12",
52
+ "typescript": "^5.7.2"
53
+ },
54
+ "keywords": [
55
+ "youtube",
56
+ "video",
57
+ "music",
58
+ "extractor",
59
+ "bun",
60
+ "typescript",
61
+ "innertube"
62
+ ],
63
+ "author": "",
64
+ "license": "MIT",
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "https://github.com/username/bundlp"
68
+ },
69
+ "engines": {
70
+ "bun": ">=1.0.0"
71
+ }
72
+ }