@mks2508/bundlp 0.1.1 → 0.1.4
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.
- package/dist/index.d.mts +614 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3131 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -8
- package/dist/core/extractor.d.ts +0 -30
- package/dist/core/extractor.d.ts.map +0 -1
- package/dist/http/client.d.ts +0 -50
- package/dist/http/client.d.ts.map +0 -1
- package/dist/http/retry.d.ts +0 -22
- package/dist/http/retry.d.ts.map +0 -1
- package/dist/index.d.ts +0 -20
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -19021
- package/dist/innertube/client.d.ts +0 -62
- package/dist/innertube/client.d.ts.map +0 -1
- package/dist/player/ast/analyzer.d.ts +0 -16
- package/dist/player/ast/analyzer.d.ts.map +0 -1
- package/dist/player/ast/extractor.d.ts +0 -35
- package/dist/player/ast/extractor.d.ts.map +0 -1
- package/dist/player/ast/matchers.d.ts +0 -40
- package/dist/player/ast/matchers.d.ts.map +0 -1
- package/dist/player/cache.d.ts +0 -60
- package/dist/player/cache.d.ts.map +0 -1
- package/dist/player/player.d.ts +0 -49
- package/dist/player/player.d.ts.map +0 -1
- package/dist/po-token/botguard/challenge.d.ts +0 -22
- package/dist/po-token/botguard/challenge.d.ts.map +0 -1
- package/dist/po-token/botguard/client.d.ts +0 -25
- package/dist/po-token/botguard/client.d.ts.map +0 -1
- package/dist/po-token/cache/token-cache.d.ts +0 -24
- package/dist/po-token/cache/token-cache.d.ts.map +0 -1
- package/dist/po-token/index.d.ts +0 -14
- package/dist/po-token/index.d.ts.map +0 -1
- package/dist/po-token/manager.d.ts +0 -34
- package/dist/po-token/manager.d.ts.map +0 -1
- package/dist/po-token/minter/web-minter.d.ts +0 -20
- package/dist/po-token/minter/web-minter.d.ts.map +0 -1
- package/dist/po-token/policies.d.ts +0 -18
- package/dist/po-token/policies.d.ts.map +0 -1
- package/dist/po-token/providers/local.provider.d.ts +0 -26
- package/dist/po-token/providers/local.provider.d.ts.map +0 -1
- package/dist/po-token/providers/provider.interface.d.ts +0 -15
- package/dist/po-token/providers/provider.interface.d.ts.map +0 -1
- package/dist/po-token/types.d.ts +0 -160
- package/dist/po-token/types.d.ts.map +0 -1
- package/dist/result/index.d.ts +0 -6
- package/dist/result/index.d.ts.map +0 -1
- package/dist/result/result.types.d.ts +0 -14
- package/dist/result/result.types.d.ts.map +0 -1
- package/dist/result/result.utils.d.ts +0 -32
- package/dist/result/result.utils.d.ts.map +0 -1
- package/dist/streaming/dash/parser.d.ts +0 -37
- package/dist/streaming/dash/parser.d.ts.map +0 -1
- package/dist/streaming/dash/segments.d.ts +0 -58
- package/dist/streaming/dash/segments.d.ts.map +0 -1
- package/dist/streaming/decipher.d.ts +0 -24
- package/dist/streaming/decipher.d.ts.map +0 -1
- package/dist/streaming/drm.d.ts +0 -26
- package/dist/streaming/drm.d.ts.map +0 -1
- package/dist/streaming/formats.d.ts +0 -20
- package/dist/streaming/formats.d.ts.map +0 -1
- package/dist/streaming/hls/parser.d.ts +0 -10
- package/dist/streaming/hls/parser.d.ts.map +0 -1
- package/dist/streaming/hls/segments.d.ts +0 -37
- package/dist/streaming/hls/segments.d.ts.map +0 -1
- package/dist/streaming/processor.d.ts +0 -20
- package/dist/streaming/processor.d.ts.map +0 -1
- package/dist/types/error.types.d.ts +0 -12
- package/dist/types/error.types.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/innertube.types.d.ts +0 -155
- package/dist/types/innertube.types.d.ts.map +0 -1
- package/dist/types/player.types.d.ts +0 -30
- package/dist/types/player.types.d.ts.map +0 -1
- package/dist/types/video.types.d.ts +0 -112
- package/dist/types/video.types.d.ts.map +0 -1
- package/dist/utils/constants.d.ts +0 -129
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/m3u8.d.ts +0 -31
- package/dist/utils/m3u8.d.ts.map +0 -1
- package/dist/utils/xml.d.ts +0 -41
- package/dist/utils/xml.d.ts.map +0 -1
- package/dist/validation/schemas.d.ts +0 -290
- package/dist/validation/schemas.d.ts.map +0 -1
package/dist/core/extractor.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type Result } from '../result';
|
|
2
|
-
import type { VideoInfo } from '../types/video.types';
|
|
3
|
-
import { type BundlpError } from '../types/error.types';
|
|
4
|
-
import type { ClientName } from '../utils/constants';
|
|
5
|
-
export interface ExtractorConfig {
|
|
6
|
-
poToken?: string;
|
|
7
|
-
cacheDir?: string;
|
|
8
|
-
preferredClient?: ClientName;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Main YouTube video extractor class.
|
|
12
|
-
* Handles video information extraction using InnerTube API.
|
|
13
|
-
*/
|
|
14
|
-
export declare class YouTubeExtractor {
|
|
15
|
-
private client;
|
|
16
|
-
private player;
|
|
17
|
-
private config;
|
|
18
|
-
constructor(config?: ExtractorConfig);
|
|
19
|
-
/**
|
|
20
|
-
* Extracts video information from a YouTube URL or video ID.
|
|
21
|
-
* @param url - YouTube URL or video ID
|
|
22
|
-
* @returns Result containing VideoInfo or BundlpError
|
|
23
|
-
*/
|
|
24
|
-
extract(url: string): Promise<Result<VideoInfo, BundlpError>>;
|
|
25
|
-
private parseVideoId;
|
|
26
|
-
private realExtract;
|
|
27
|
-
private processFormats;
|
|
28
|
-
private assembleVideoInfo;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -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"}
|
package/dist/http/client.d.ts
DELETED
|
@@ -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"}
|
package/dist/http/retry.d.ts
DELETED
|
@@ -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
|
package/dist/http/retry.d.ts.map
DELETED
|
@@ -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
|
package/dist/index.d.ts.map
DELETED
|
@@ -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"}
|