@mks2508/bundlp 0.1.1 → 0.1.2

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 (86) hide show
  1. package/dist/index.d.mts +614 -0
  2. package/dist/index.d.mts.map +1 -0
  3. package/dist/index.mjs +3072 -0
  4. package/dist/index.mjs.map +1 -0
  5. package/package.json +18 -8
  6. package/dist/core/extractor.d.ts +0 -30
  7. package/dist/core/extractor.d.ts.map +0 -1
  8. package/dist/http/client.d.ts +0 -50
  9. package/dist/http/client.d.ts.map +0 -1
  10. package/dist/http/retry.d.ts +0 -22
  11. package/dist/http/retry.d.ts.map +0 -1
  12. package/dist/index.d.ts +0 -20
  13. package/dist/index.d.ts.map +0 -1
  14. package/dist/index.js +0 -19021
  15. package/dist/innertube/client.d.ts +0 -62
  16. package/dist/innertube/client.d.ts.map +0 -1
  17. package/dist/player/ast/analyzer.d.ts +0 -16
  18. package/dist/player/ast/analyzer.d.ts.map +0 -1
  19. package/dist/player/ast/extractor.d.ts +0 -35
  20. package/dist/player/ast/extractor.d.ts.map +0 -1
  21. package/dist/player/ast/matchers.d.ts +0 -40
  22. package/dist/player/ast/matchers.d.ts.map +0 -1
  23. package/dist/player/cache.d.ts +0 -60
  24. package/dist/player/cache.d.ts.map +0 -1
  25. package/dist/player/player.d.ts +0 -49
  26. package/dist/player/player.d.ts.map +0 -1
  27. package/dist/po-token/botguard/challenge.d.ts +0 -22
  28. package/dist/po-token/botguard/challenge.d.ts.map +0 -1
  29. package/dist/po-token/botguard/client.d.ts +0 -25
  30. package/dist/po-token/botguard/client.d.ts.map +0 -1
  31. package/dist/po-token/cache/token-cache.d.ts +0 -24
  32. package/dist/po-token/cache/token-cache.d.ts.map +0 -1
  33. package/dist/po-token/index.d.ts +0 -14
  34. package/dist/po-token/index.d.ts.map +0 -1
  35. package/dist/po-token/manager.d.ts +0 -34
  36. package/dist/po-token/manager.d.ts.map +0 -1
  37. package/dist/po-token/minter/web-minter.d.ts +0 -20
  38. package/dist/po-token/minter/web-minter.d.ts.map +0 -1
  39. package/dist/po-token/policies.d.ts +0 -18
  40. package/dist/po-token/policies.d.ts.map +0 -1
  41. package/dist/po-token/providers/local.provider.d.ts +0 -26
  42. package/dist/po-token/providers/local.provider.d.ts.map +0 -1
  43. package/dist/po-token/providers/provider.interface.d.ts +0 -15
  44. package/dist/po-token/providers/provider.interface.d.ts.map +0 -1
  45. package/dist/po-token/types.d.ts +0 -160
  46. package/dist/po-token/types.d.ts.map +0 -1
  47. package/dist/result/index.d.ts +0 -6
  48. package/dist/result/index.d.ts.map +0 -1
  49. package/dist/result/result.types.d.ts +0 -14
  50. package/dist/result/result.types.d.ts.map +0 -1
  51. package/dist/result/result.utils.d.ts +0 -32
  52. package/dist/result/result.utils.d.ts.map +0 -1
  53. package/dist/streaming/dash/parser.d.ts +0 -37
  54. package/dist/streaming/dash/parser.d.ts.map +0 -1
  55. package/dist/streaming/dash/segments.d.ts +0 -58
  56. package/dist/streaming/dash/segments.d.ts.map +0 -1
  57. package/dist/streaming/decipher.d.ts +0 -24
  58. package/dist/streaming/decipher.d.ts.map +0 -1
  59. package/dist/streaming/drm.d.ts +0 -26
  60. package/dist/streaming/drm.d.ts.map +0 -1
  61. package/dist/streaming/formats.d.ts +0 -20
  62. package/dist/streaming/formats.d.ts.map +0 -1
  63. package/dist/streaming/hls/parser.d.ts +0 -10
  64. package/dist/streaming/hls/parser.d.ts.map +0 -1
  65. package/dist/streaming/hls/segments.d.ts +0 -37
  66. package/dist/streaming/hls/segments.d.ts.map +0 -1
  67. package/dist/streaming/processor.d.ts +0 -20
  68. package/dist/streaming/processor.d.ts.map +0 -1
  69. package/dist/types/error.types.d.ts +0 -12
  70. package/dist/types/error.types.d.ts.map +0 -1
  71. package/dist/types/index.d.ts +0 -8
  72. package/dist/types/index.d.ts.map +0 -1
  73. package/dist/types/innertube.types.d.ts +0 -155
  74. package/dist/types/innertube.types.d.ts.map +0 -1
  75. package/dist/types/player.types.d.ts +0 -30
  76. package/dist/types/player.types.d.ts.map +0 -1
  77. package/dist/types/video.types.d.ts +0 -112
  78. package/dist/types/video.types.d.ts.map +0 -1
  79. package/dist/utils/constants.d.ts +0 -129
  80. package/dist/utils/constants.d.ts.map +0 -1
  81. package/dist/utils/m3u8.d.ts +0 -31
  82. package/dist/utils/m3u8.d.ts.map +0 -1
  83. package/dist/utils/xml.d.ts +0 -41
  84. package/dist/utils/xml.d.ts.map +0 -1
  85. package/dist/validation/schemas.d.ts +0 -290
  86. package/dist/validation/schemas.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/core/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAS,MAAM,WAAW,CAAC;AAIxD,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,UAAU,CAAC;CAChC;AAaD;;;GAGG;AACH,qBAAa,gBAAgB;IACzB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,GAAE,eAAoB;IAMxC;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAgBnE,OAAO,CAAC,YAAY;YAcN,WAAW;YAyBX,cAAc;IAK5B,OAAO,CAAC,iBAAiB;CA2B5B"}
@@ -1,50 +0,0 @@
1
- import { type Result } from '../result';
2
- import type { BundlpError } from '../types/error.types';
3
- export interface HttpClientOptions extends RequestInit {
4
- timeout?: number;
5
- maxRedirects?: number;
6
- manualRedirects?: boolean;
7
- }
8
- interface Cookie {
9
- name: string;
10
- value: string;
11
- domain?: string;
12
- path?: string;
13
- expires?: Date;
14
- secure?: boolean;
15
- httpOnly?: boolean;
16
- }
17
- /**
18
- * HTTP client with cookie jar and controlled redirect handling.
19
- * Superior to YouTube.js: tracks cookies across redirects, prevents loops.
20
- */
21
- export declare class HttpClient {
22
- private cookies;
23
- /**
24
- * Performs a fetch request with automatic cookie and redirect handling.
25
- * @param url - The URL to fetch
26
- * @param options - Fetch options. Use manualRedirects=true for controlled redirects
27
- * @returns Result containing the Response or a BundlpError
28
- */
29
- request(url: string, options?: HttpClientOptions): Promise<Result<Response, BundlpError>>;
30
- clearCookies(): void;
31
- getCookies(): Map<string, Cookie>;
32
- /**
33
- * Performs a GET request.
34
- * @param url - The URL to fetch
35
- * @param options - Optional fetch options
36
- * @returns Result containing the Response or a BundlpError
37
- */
38
- get(url: string, options?: HttpClientOptions): Promise<Result<Response, BundlpError>>;
39
- /**
40
- * Performs a POST request with JSON body.
41
- * @param url - The URL to post to
42
- * @param body - The request body (will be JSON stringified)
43
- * @param options - Optional fetch options
44
- * @returns Result containing the Response or a BundlpError
45
- */
46
- post(url: string, body: unknown, options?: HttpClientOptions): Promise<Result<Response, BundlpError>>;
47
- }
48
- export declare const httpClient: HttpClient;
49
- export {};
50
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,MAAM;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AA8BD;;;GAGG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,OAAO,CAAkC;IAEjD;;;;;OAKG;IACG,OAAO,CACT,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAkFzC,YAAY,IAAI,IAAI;IAIpB,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAIjC;;;;;OAKG;IACG,GAAG,CACL,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAIzC;;;;;;OAMG;IACG,IAAI,CACN,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;CAW5C;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Retry utilities with exponential backoff.
3
- * Provides automatic retry logic for transient failures.
4
- * @module http/retry
5
- */
6
- export interface RetryOptions {
7
- retries?: number;
8
- delay?: number;
9
- backoff?: number;
10
- maxDelay?: number;
11
- shouldRetry?: (error: Error) => boolean;
12
- onRetry?: (error: Error, attempt: number) => void;
13
- }
14
- /**
15
- * Executes a function with automatic retry on failure.
16
- * @param fn - The async function to execute
17
- * @param options - Retry configuration options
18
- * @returns The result of the function if successful
19
- * @throws The last error if all retries are exhausted
20
- */
21
- export declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
22
- //# sourceMappingURL=retry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/http/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;AAID;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC7B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,GAAE,YAAiB,GAC3B,OAAO,CAAC,CAAC,CAAC,CA2BZ"}
package/dist/index.d.ts DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * bundlp - Bun-native YouTube video/music resolver
3
- *
4
- * @example
5
- * ```typescript
6
- * import { YouTubeExtractor, isOk } from 'bundlp';
7
- *
8
- * const extractor = new YouTubeExtractor();
9
- * const result = await extractor.extract('https://youtube.com/watch?v=dQw4w9WgXcQ');
10
- *
11
- * if (isOk(result)) {
12
- * console.log(result.value.title);
13
- * console.log(result.value.formats.video);
14
- * }
15
- * ```
16
- */
17
- export { type Result, type ResultOk, type ResultErr, ok, err, isOk, isErr, match, map, mapErr, andThen, unwrapOr, unwrap, tryCatch, tryCatchAsync, } from './result';
18
- export type { VideoInfo, ChannelInfo, Thumbnail, FormatCollection, Format, AudioFormat, VideoFormat, HlsInfo, HlsVariant, DashInfo, Subtitle, Chapter, Storyboard, ErrorCode, BundlpError, ClientName, ClientConfig, InnerTubeContext, PlayerResponse, StreamingData, PlayerInfo, SignatureCipher, } from './types';
19
- export { YouTubeExtractor, type ExtractorConfig } from './core/extractor';
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,EAAE,EACF,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,GAAG,EACH,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,aAAa,GACd,MAAM,UAAU,CAAC;AAGlB,YAAY,EAEV,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,WAAW,EACX,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAU,EAEV,SAAS,EACT,WAAW,EAEX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,aAAa,EAEb,UAAU,EACV,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC"}