ytdwn 1.0.0 → 1.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.
- package/README.md +121 -81
- package/dist/index.js +461 -333
- package/dist/src/cli/commands.d.ts +18 -0
- package/dist/src/cli/errors.d.ts +8 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/config.d.ts +6 -3
- package/dist/src/layers/AppLive.d.ts +14 -0
- package/dist/src/layers/index.d.ts +1 -0
- package/dist/src/lib/errors.d.ts +92 -0
- package/dist/src/lib/filesystem.d.ts +27 -0
- package/dist/src/lib/http.d.ts +6 -0
- package/dist/src/lib/index.d.ts +3 -0
- package/dist/src/services/BinaryService.d.ts +14 -0
- package/dist/src/services/DownloadService.d.ts +22 -0
- package/dist/src/services/SettingsService.d.ts +14 -0
- package/dist/src/services/index.d.ts +3 -0
- package/dist/src/timestamp.d.ts +16 -0
- package/package.json +6 -3
- package/dist/src/binary.d.ts +0 -12
- package/dist/src/download.d.ts +0 -16
- package/dist/src/settings.d.ts +0 -24
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { BinaryService, DownloadService, SettingsService } from "../services";
|
|
3
|
+
import type { DownloadOptions } from "../services";
|
|
4
|
+
export interface FolderOptions {
|
|
5
|
+
readonly reset?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Prepare command: Downloads yt-dlp binary if not present.
|
|
9
|
+
*/
|
|
10
|
+
export declare const prepareCommand: Effect.Effect<void, import("../lib").FileWriteError | import("../lib").DirectoryCreateError | import("../lib").DownloadError | import("../lib").BinaryDownloadError, BinaryService>;
|
|
11
|
+
/**
|
|
12
|
+
* Set folder command: Manages default download directory.
|
|
13
|
+
*/
|
|
14
|
+
export declare const setFolderCommand: (path?: string, options?: FolderOptions) => Effect.Effect<void, import("../lib").FileWriteError, SettingsService>;
|
|
15
|
+
/**
|
|
16
|
+
* Download command: Downloads audio from YouTube URL.
|
|
17
|
+
*/
|
|
18
|
+
export declare const downloadCommand: (url: string, options: DownloadOptions) => Effect.Effect<void, import("../lib").DirectoryCreateError | import("../lib").BinaryNotFoundError | (import("../lib").BinaryExecutionError | import("../lib").VideoNotFoundError | import("../lib").InvalidUrlError | import("../lib").AgeRestrictedError | import("../lib").ConnectionError), DownloadService>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { BinaryNotFoundError, VideoNotFoundError, InvalidUrlError, AgeRestrictedError, ConnectionError, BinaryExecutionError, BinaryDownloadError, NetworkError, FileWriteError, DirectoryCreateError } from "../lib/errors";
|
|
3
|
+
export type AppError = BinaryNotFoundError | VideoNotFoundError | InvalidUrlError | AgeRestrictedError | ConnectionError | BinaryExecutionError | BinaryDownloadError | NetworkError | FileWriteError | DirectoryCreateError;
|
|
4
|
+
export declare const formatError: (error: unknown) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Runs an effect with error handling. Main entry point for CLI commands.
|
|
7
|
+
*/
|
|
8
|
+
export declare const runCommand: <A, E, R>(effect: Effect.Effect<A, E, R>, layer: Layer.Layer<R>) => Promise<A>;
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export declare const APP_NAME = "ytdwn";
|
|
2
|
-
export declare const APP_TAGLINE = "YouTube to MP3 \u2022 Fast & Simple";
|
|
3
|
-
export declare const APP_VERSION = "1.
|
|
4
|
-
export declare const
|
|
2
|
+
export declare const APP_TAGLINE = "YouTube to MP3/MP4 \u2022 Fast & Simple";
|
|
3
|
+
export declare const APP_VERSION = "1.1.0";
|
|
4
|
+
export declare const DEFAULT_AUDIO_FORMAT = "mp3";
|
|
5
5
|
export declare const DEFAULT_AUDIO_QUALITY = "0";
|
|
6
|
+
export declare const DEFAULT_VIDEO_FORMAT = "mp4";
|
|
7
|
+
export declare const DEFAULT_VIDEO_QUALITY = "best";
|
|
6
8
|
export declare const CONCURRENT_FRAGMENTS = "8";
|
|
9
|
+
export declare const DEFAULT_FORMAT = "mp3";
|
|
7
10
|
export declare const BIN_DIR: string;
|
|
8
11
|
export declare const getOutputTemplate: (downloadDir: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* Composes all service layers into a single application layer.
|
|
4
|
+
* This is the production layer used at the application boundary.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AppLive: Layer.Layer<import("../services/DownloadService").DownloadService, never, never>;
|
|
7
|
+
/**
|
|
8
|
+
* Settings-only layer for commands that don't need download capabilities.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SettingsLive: Layer.Layer<import("../services/SettingsService").SettingsService, never, never>;
|
|
11
|
+
/**
|
|
12
|
+
* Binary management layer (includes settings).
|
|
13
|
+
*/
|
|
14
|
+
export declare const BinaryLive: Layer.Layer<import("../services/BinaryService").BinaryService, never, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppLive, SettingsLive, BinaryLive } from "./AppLive";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
declare const FileWriteError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
2
|
+
readonly _tag: "FileWriteError";
|
|
3
|
+
} & Readonly<A>;
|
|
4
|
+
export declare class FileWriteError extends FileWriteError_base<{
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly cause?: unknown;
|
|
7
|
+
}> {
|
|
8
|
+
}
|
|
9
|
+
declare const DirectoryCreateError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
10
|
+
readonly _tag: "DirectoryCreateError";
|
|
11
|
+
} & Readonly<A>;
|
|
12
|
+
export declare class DirectoryCreateError extends DirectoryCreateError_base<{
|
|
13
|
+
readonly path: string;
|
|
14
|
+
readonly cause?: unknown;
|
|
15
|
+
}> {
|
|
16
|
+
}
|
|
17
|
+
declare const NetworkError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
18
|
+
readonly _tag: "NetworkError";
|
|
19
|
+
} & Readonly<A>;
|
|
20
|
+
export declare class NetworkError extends NetworkError_base<{
|
|
21
|
+
readonly url?: string;
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}> {
|
|
24
|
+
}
|
|
25
|
+
declare const DownloadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
26
|
+
readonly _tag: "DownloadError";
|
|
27
|
+
} & Readonly<A>;
|
|
28
|
+
export declare class DownloadError extends DownloadError_base<{
|
|
29
|
+
readonly url: string;
|
|
30
|
+
readonly cause?: unknown;
|
|
31
|
+
}> {
|
|
32
|
+
}
|
|
33
|
+
declare const BinaryNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
34
|
+
readonly _tag: "BinaryNotFoundError";
|
|
35
|
+
} & Readonly<A>;
|
|
36
|
+
export declare class BinaryNotFoundError extends BinaryNotFoundError_base<{
|
|
37
|
+
readonly message: string;
|
|
38
|
+
}> {
|
|
39
|
+
}
|
|
40
|
+
declare const BinaryDownloadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
41
|
+
readonly _tag: "BinaryDownloadError";
|
|
42
|
+
} & Readonly<A>;
|
|
43
|
+
export declare class BinaryDownloadError extends BinaryDownloadError_base<{
|
|
44
|
+
readonly platform: string;
|
|
45
|
+
readonly cause?: unknown;
|
|
46
|
+
}> {
|
|
47
|
+
}
|
|
48
|
+
declare const BinaryExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
49
|
+
readonly _tag: "BinaryExecutionError";
|
|
50
|
+
} & Readonly<A>;
|
|
51
|
+
export declare class BinaryExecutionError extends BinaryExecutionError_base<{
|
|
52
|
+
readonly exitCode: number;
|
|
53
|
+
readonly message: string;
|
|
54
|
+
}> {
|
|
55
|
+
}
|
|
56
|
+
declare const TimestampParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
57
|
+
readonly _tag: "TimestampParseError";
|
|
58
|
+
} & Readonly<A>;
|
|
59
|
+
export declare class TimestampParseError extends TimestampParseError_base<{
|
|
60
|
+
readonly input: string;
|
|
61
|
+
readonly message: string;
|
|
62
|
+
}> {
|
|
63
|
+
}
|
|
64
|
+
declare const VideoNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
65
|
+
readonly _tag: "VideoNotFoundError";
|
|
66
|
+
} & Readonly<A>;
|
|
67
|
+
export declare class VideoNotFoundError extends VideoNotFoundError_base<{
|
|
68
|
+
readonly url: string;
|
|
69
|
+
}> {
|
|
70
|
+
}
|
|
71
|
+
declare const InvalidUrlError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
72
|
+
readonly _tag: "InvalidUrlError";
|
|
73
|
+
} & Readonly<A>;
|
|
74
|
+
export declare class InvalidUrlError extends InvalidUrlError_base<{
|
|
75
|
+
readonly url: string;
|
|
76
|
+
}> {
|
|
77
|
+
}
|
|
78
|
+
declare const AgeRestrictedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
79
|
+
readonly _tag: "AgeRestrictedError";
|
|
80
|
+
} & Readonly<A>;
|
|
81
|
+
export declare class AgeRestrictedError extends AgeRestrictedError_base<{
|
|
82
|
+
readonly url: string;
|
|
83
|
+
}> {
|
|
84
|
+
}
|
|
85
|
+
declare const ConnectionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
86
|
+
readonly _tag: "ConnectionError";
|
|
87
|
+
} & Readonly<A>;
|
|
88
|
+
export declare class ConnectionError extends ConnectionError_base<{
|
|
89
|
+
readonly message: string;
|
|
90
|
+
}> {
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { FileWriteError, DirectoryCreateError } from "./errors";
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a file exists and is executable.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isExecutable: (path: string) => Effect.Effect<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Reads and parses a JSON file, returning default if it fails.
|
|
9
|
+
*/
|
|
10
|
+
export declare const readJsonFileOrDefault: <T>(path: string, defaultValue: T) => Effect.Effect<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Writes an object as JSON to a file.
|
|
13
|
+
*/
|
|
14
|
+
export declare const writeJsonFile: <T>(path: string, data: T) => Effect.Effect<void, FileWriteError>;
|
|
15
|
+
/**
|
|
16
|
+
* Writes binary data to a file.
|
|
17
|
+
*/
|
|
18
|
+
export declare const writeFileBinary: (path: string, data: Buffer) => Effect.Effect<void, FileWriteError>;
|
|
19
|
+
/**
|
|
20
|
+
* Ensures a directory exists, creating it if necessary.
|
|
21
|
+
* Returns the path for chaining.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ensureDirectory: (path: string) => Effect.Effect<string, DirectoryCreateError>;
|
|
24
|
+
/**
|
|
25
|
+
* Makes a file executable (chmod +x).
|
|
26
|
+
*/
|
|
27
|
+
export declare const makeExecutable: (path: string) => Effect.Effect<void, FileWriteError>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FileWriteError, DirectoryCreateError, NetworkError, DownloadError, BinaryNotFoundError, BinaryDownloadError, BinaryExecutionError, TimestampParseError, VideoNotFoundError, InvalidUrlError, AgeRestrictedError, ConnectionError, } from "./errors";
|
|
2
|
+
export { isExecutable, readJsonFileOrDefault, writeJsonFile, writeFileBinary, ensureDirectory, makeExecutable, } from "./filesystem";
|
|
3
|
+
export { fetchBinaryWithRetry } from "./http";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Effect, Context, Layer } from "effect";
|
|
2
|
+
import YTDlpWrap from "yt-dlp-wrap";
|
|
3
|
+
import { BinaryNotFoundError, BinaryDownloadError, type DownloadError, type FileWriteError, type DirectoryCreateError } from "../lib/errors";
|
|
4
|
+
import { SettingsService } from "./SettingsService";
|
|
5
|
+
declare const BinaryService_base: Context.TagClass<BinaryService, "BinaryService", {
|
|
6
|
+
readonly findBinary: Effect.Effect<string | null>;
|
|
7
|
+
readonly requireBinary: Effect.Effect<string, BinaryNotFoundError>;
|
|
8
|
+
readonly getYtDlpWrap: Effect.Effect<YTDlpWrap, BinaryNotFoundError>;
|
|
9
|
+
readonly downloadLatestBinary: Effect.Effect<string, BinaryDownloadError | DownloadError | FileWriteError | DirectoryCreateError>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class BinaryService extends BinaryService_base {
|
|
12
|
+
}
|
|
13
|
+
export declare const BinaryServiceLive: Layer.Layer<BinaryService, never, SettingsService>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Effect, Context, Layer } from "effect";
|
|
2
|
+
import { BinaryExecutionError, VideoNotFoundError, InvalidUrlError, AgeRestrictedError, ConnectionError, type BinaryNotFoundError, type DirectoryCreateError } from "../lib/errors";
|
|
3
|
+
import { BinaryService } from "./BinaryService";
|
|
4
|
+
import { SettingsService } from "./SettingsService";
|
|
5
|
+
export interface DownloadOptions {
|
|
6
|
+
format: string;
|
|
7
|
+
clip?: string;
|
|
8
|
+
quiet?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DownloadResult {
|
|
11
|
+
filePath: string;
|
|
12
|
+
fileName: string;
|
|
13
|
+
fileSize?: string;
|
|
14
|
+
}
|
|
15
|
+
type DownloadPipelineError = BinaryExecutionError | VideoNotFoundError | InvalidUrlError | AgeRestrictedError | ConnectionError;
|
|
16
|
+
declare const DownloadService_base: Context.TagClass<DownloadService, "DownloadService", {
|
|
17
|
+
readonly download: (url: string, options: DownloadOptions) => Effect.Effect<DownloadResult, BinaryNotFoundError | DirectoryCreateError | DownloadPipelineError>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare class DownloadService extends DownloadService_base {
|
|
20
|
+
}
|
|
21
|
+
export declare const DownloadServiceLive: Layer.Layer<DownloadService, never, SettingsService | BinaryService>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Effect, Context, Layer } from "effect";
|
|
2
|
+
import type { FileWriteError } from "../lib/errors";
|
|
3
|
+
declare const SettingsService_base: Context.TagClass<SettingsService, "SettingsService", {
|
|
4
|
+
readonly getDownloadDir: Effect.Effect<string>;
|
|
5
|
+
readonly setDownloadDir: (dir: string) => Effect.Effect<void, FileWriteError>;
|
|
6
|
+
readonly resetDownloadDir: Effect.Effect<void, FileWriteError>;
|
|
7
|
+
readonly getCachedBinaryPath: Effect.Effect<string | null>;
|
|
8
|
+
readonly setCachedBinaryPath: (path: string) => Effect.Effect<void, FileWriteError>;
|
|
9
|
+
readonly clearCachedBinaryPath: Effect.Effect<void, FileWriteError>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class SettingsService extends SettingsService_base {
|
|
12
|
+
}
|
|
13
|
+
export declare const SettingsServiceLive: Layer.Layer<SettingsService, never, never>;
|
|
14
|
+
export {};
|
package/dist/src/timestamp.d.ts
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { TimestampParseError } from "./lib/errors";
|
|
1
3
|
/**
|
|
2
4
|
* Parses a raw timestamp string into HH:MM:SS format.
|
|
3
5
|
* Accepts MM:SS or HH:MM:SS formats.
|
|
6
|
+
* Returns an Effect that fails with TimestampParseError if invalid.
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseTimestampEffect: (raw: string) => Effect.Effect<string, TimestampParseError>;
|
|
9
|
+
/**
|
|
10
|
+
* Parses a clip range string (start-end) into normalized format.
|
|
11
|
+
* Returns an Effect that fails with TimestampParseError if invalid.
|
|
12
|
+
*/
|
|
13
|
+
export declare const parseClipRangeEffect: (range: string) => Effect.Effect<string, TimestampParseError>;
|
|
14
|
+
/**
|
|
15
|
+
* Parses a raw timestamp string into HH:MM:SS format.
|
|
16
|
+
* @throws Error if format is invalid
|
|
17
|
+
* @deprecated Use parseTimestampEffect for type-safe error handling
|
|
4
18
|
*/
|
|
5
19
|
export declare function parseTimestamp(raw: string): string;
|
|
6
20
|
/**
|
|
7
21
|
* Parses a clip range string (start-end) into normalized format.
|
|
22
|
+
* @throws Error if format is invalid
|
|
23
|
+
* @deprecated Use parseClipRangeEffect for type-safe error handling
|
|
8
24
|
*/
|
|
9
25
|
export declare function parseClipRange(range: string): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ytdwn",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A fast and simple CLI tool to download audio from YouTube
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A fast and simple CLI tool to download audio and video from YouTube",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Batikan Kutluer",
|
|
7
7
|
"url": "https://github.com/batikankutluer"
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"youtube",
|
|
20
20
|
"download",
|
|
21
21
|
"mp3",
|
|
22
|
+
"mp4",
|
|
23
|
+
"video",
|
|
22
24
|
"audio",
|
|
23
25
|
"yt-dlp",
|
|
24
26
|
"cli",
|
|
@@ -48,12 +50,13 @@
|
|
|
48
50
|
"build:types": "bun x tsc --project tsconfig.build.json --emitDeclarationOnly",
|
|
49
51
|
"build:chmod": "chmod +x dist/index.js",
|
|
50
52
|
"typecheck": "bun x tsc --noEmit",
|
|
53
|
+
"test": "bun test",
|
|
51
54
|
"prepublishOnly": "bun run build"
|
|
52
55
|
},
|
|
53
56
|
"dependencies": {
|
|
54
|
-
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
55
57
|
"cfonts": "^3.3.1",
|
|
56
58
|
"commander": "^14.0.2",
|
|
59
|
+
"effect": "^3.19.14",
|
|
57
60
|
"gradient-string": "^3.0.0",
|
|
58
61
|
"picocolors": "^1.1.1",
|
|
59
62
|
"yt-dlp-wrap": "^2.3.12"
|
package/dist/src/binary.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Finds an existing prepared binary. Uses cache for speed.
|
|
3
|
-
*/
|
|
4
|
-
export declare function findBinary(): Promise<string | null>;
|
|
5
|
-
/**
|
|
6
|
-
* Ensures a prepared binary exists, throws if not.
|
|
7
|
-
*/
|
|
8
|
-
export declare function requireBinary(): Promise<string>;
|
|
9
|
-
/**
|
|
10
|
-
* Downloads the latest yt-dlp binary from GitHub.
|
|
11
|
-
*/
|
|
12
|
-
export declare function downloadLatestBinary(): Promise<string>;
|
package/dist/src/download.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface DownloadOptions {
|
|
2
|
-
format: string;
|
|
3
|
-
clip?: string;
|
|
4
|
-
quiet?: boolean;
|
|
5
|
-
}
|
|
6
|
-
interface DownloadResult {
|
|
7
|
-
filePath: string;
|
|
8
|
-
fileName: string;
|
|
9
|
-
fileSize?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Downloads audio from a URL using yt-dlp.
|
|
13
|
-
* @returns Download result with file info
|
|
14
|
-
*/
|
|
15
|
-
export declare function downloadAudio(url: string, options: DownloadOptions): Promise<DownloadResult>;
|
|
16
|
-
export {};
|
package/dist/src/settings.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the download directory. Falls back to current directory if not set.
|
|
3
|
-
*/
|
|
4
|
-
export declare function getDownloadDir(): Promise<string>;
|
|
5
|
-
/**
|
|
6
|
-
* Sets the download directory.
|
|
7
|
-
*/
|
|
8
|
-
export declare function setDownloadDir(dir: string): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Resets the download directory to default (current directory).
|
|
11
|
-
*/
|
|
12
|
-
export declare function resetDownloadDir(): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Gets the cached binary path.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getCachedBinaryPath(): Promise<string | null>;
|
|
17
|
-
/**
|
|
18
|
-
* Sets the cached binary path.
|
|
19
|
-
*/
|
|
20
|
-
export declare function setCachedBinaryPath(path: string): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Clears the cached binary path.
|
|
23
|
-
*/
|
|
24
|
-
export declare function clearCachedBinaryPath(): Promise<void>;
|