@boy-offi9-inc/tidepull 0.5.0 → 0.6.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 +3 -3
- package/dist/cliutil.d.ts +0 -8
- package/dist/cliutil.js +0 -10
- package/dist/cookies.d.ts +0 -5
- package/dist/cookies.js +0 -10
- package/dist/core/downloader.d.ts +1 -10
- package/dist/core/downloader.js +44 -9
- package/dist/core/errors.d.ts +0 -2
- package/dist/core/errors.js +0 -2
- package/dist/core/events.d.ts +0 -2
- package/dist/core/hls.d.ts +0 -2
- package/dist/core/hls.js +2 -3
- package/dist/core/http.d.ts +0 -13
- package/dist/core/http.js +0 -7
- package/dist/core/meter.d.ts +0 -1
- package/dist/core/meter.js +0 -1
- package/dist/core/pipeline.d.ts +1 -13
- package/dist/core/pipeline.js +16 -8
- package/dist/core/selector.d.ts +0 -10
- package/dist/core/selector.js +0 -1
- package/dist/core/template.d.ts +0 -1
- package/dist/core/template.js +0 -1
- package/dist/core/types.d.ts +7 -13
- package/dist/dash/index.js +1 -6
- package/dist/dash/parse.d.ts +0 -3
- package/dist/dash/parse.js +1 -3
- package/dist/dash/xml.js +0 -1
- package/dist/extractors/direct.js +0 -1
- package/dist/extractors/generic.d.ts +0 -1
- package/dist/extractors/generic.js +0 -2
- package/dist/extractors/hls.js +6 -3
- package/dist/extractors/index.d.ts +0 -1
- package/dist/extractors/index.js +0 -1
- package/dist/feeds.d.ts +0 -2
- package/dist/feeds.js +0 -9
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/loader.d.ts +0 -2
- package/dist/loader.js +0 -3
- package/dist/main.d.ts +0 -1
- package/dist/main.js +3 -8
- package/dist/playlist.d.ts +0 -18
- package/dist/playlist.js +0 -15
- package/dist/plugins.d.ts +0 -2
- package/dist/plugins.js +0 -2
- package/dist/tidepull.d.ts +0 -21
- package/dist/tidepull.js +0 -18
- package/dist/ui/banner.d.ts +0 -1
- package/dist/ui/banner.js +0 -2
- package/dist/ui/format.d.ts +0 -1
- package/dist/ui/format.js +0 -1
- package/dist/ui/log.d.ts +0 -2
- package/dist/ui/log.js +0 -2
- package/dist/ui/render.d.ts +0 -2
- package/dist/ui/render.js +0 -3
- package/dist/ui/spinner.d.ts +0 -5
- package/dist/ui/spinner.js +0 -5
- package/dist/ui/theme.d.ts +0 -5
- package/dist/ui/theme.js +0 -2
- package/package.json +1 -1
package/dist/ui/format.d.ts
CHANGED
package/dist/ui/format.js
CHANGED
|
@@ -19,7 +19,6 @@ export function fmtTime(sec) {
|
|
|
19
19
|
const ss = String(s % 60).padStart(2, "0");
|
|
20
20
|
return h ? `${h}:${m}:${ss}` : `${m}:${ss}`;
|
|
21
21
|
}
|
|
22
|
-
/** Simple left-aligned table. */
|
|
23
22
|
export function table(rows) {
|
|
24
23
|
const widths = rows[0].map((_, c) => Math.max(...rows.map((r) => (r[c] ?? "").length)));
|
|
25
24
|
return rows.map((r) => r.map((cell, c) => (cell ?? "").padEnd(widths[c])).join(" ").trimEnd()).join("\n");
|
package/dist/ui/log.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export interface LoggerOptions {
|
|
|
5
5
|
color?: boolean;
|
|
6
6
|
theme?: Theme | string;
|
|
7
7
|
}
|
|
8
|
-
/** Honors NO_COLOR / FORCE_COLOR, and only colors a real terminal. */
|
|
9
8
|
export declare function shouldUseColor(env?: NodeJS.ProcessEnv, isTTY?: boolean): boolean;
|
|
10
|
-
/** All human-facing output goes to stderr. stdout is reserved for data you can pipe. */
|
|
11
9
|
export declare class Logger {
|
|
12
10
|
quiet: boolean;
|
|
13
11
|
verbose: boolean;
|
package/dist/ui/log.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getTheme } from "./theme.js";
|
|
2
|
-
/** Honors NO_COLOR / FORCE_COLOR, and only colors a real terminal. */
|
|
3
2
|
export function shouldUseColor(env = process.env, isTTY = !!process.stderr.isTTY) {
|
|
4
3
|
if (env.NO_COLOR)
|
|
5
4
|
return false;
|
|
@@ -7,7 +6,6 @@ export function shouldUseColor(env = process.env, isTTY = !!process.stderr.isTTY
|
|
|
7
6
|
return true;
|
|
8
7
|
return isTTY && env.TERM !== "dumb";
|
|
9
8
|
}
|
|
10
|
-
/** All human-facing output goes to stderr. stdout is reserved for data you can pipe. */
|
|
11
9
|
export class Logger {
|
|
12
10
|
quiet;
|
|
13
11
|
verbose;
|
package/dist/ui/render.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { TidepullEvent } from "../core/events.js";
|
|
2
2
|
import type { Logger } from "./log.js";
|
|
3
3
|
import type { Theme } from "./theme.js";
|
|
4
|
-
/** Renders engine events as terminal output on stderr, redrawing one progress line on a TTY. */
|
|
5
4
|
export declare function humanRenderer(log: Logger, o: {
|
|
6
5
|
progress: boolean;
|
|
7
6
|
stream?: NodeJS.WriteStream;
|
|
8
7
|
theme?: Theme | string;
|
|
9
8
|
}): (e: TidepullEvent) => void;
|
|
10
|
-
/** Writes one JSON event per line to stdout (NDJSON). */
|
|
11
9
|
export declare const jsonRenderer: () => ((e: TidepullEvent) => void);
|
package/dist/ui/render.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { fmtBytes, fmtTime } from "./format.js";
|
|
2
2
|
import { getTheme } from "./theme.js";
|
|
3
|
-
/** Renders engine events as terminal output on stderr, redrawing one progress line on a TTY. */
|
|
4
3
|
export function humanRenderer(log, o) {
|
|
5
4
|
const stream = o.stream ?? process.stderr;
|
|
6
5
|
const theme = typeof o.theme === "string" ? getTheme(o.theme) : (o.theme ?? log.theme);
|
|
@@ -37,7 +36,6 @@ export function humanRenderer(log, o) {
|
|
|
37
36
|
const size = e.total ? ` of ${e.estimated ? "~" : ""}${fmtBytes(e.total)}` : ` ${fmtBytes(e.downloaded)}`;
|
|
38
37
|
const rate = e.speed ? ` at ${fmtBytes(e.speed)}/s` : "";
|
|
39
38
|
const eta = e.eta !== undefined ? ` ETA ${fmtTime(e.eta)}` : "";
|
|
40
|
-
// Keep the line narrower than the terminal: a wrapped line cannot be redrawn in place.
|
|
41
39
|
let line = `[download] ${pct}${size}${rate}${eta}`;
|
|
42
40
|
if (line.length >= cols)
|
|
43
41
|
line = `[download] ${pct}${size}${rate}`;
|
|
@@ -76,5 +74,4 @@ export function humanRenderer(log, o) {
|
|
|
76
74
|
}
|
|
77
75
|
};
|
|
78
76
|
}
|
|
79
|
-
/** Writes one JSON event per line to stdout (NDJSON). */
|
|
80
77
|
export const jsonRenderer = () => (e) => void process.stdout.write(JSON.stringify(e) + "\n");
|
package/dist/ui/spinner.d.ts
CHANGED
|
@@ -4,11 +4,6 @@ export interface SpinnerOptions {
|
|
|
4
4
|
env?: NodeJS.ProcessEnv;
|
|
5
5
|
interval?: number;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Single-line activity spinner on stderr. Never touches stdout, and never
|
|
9
|
-
* starts at all when stderr is not a TTY or CI is detected: machine modes
|
|
10
|
-
* must see zero bytes from it.
|
|
11
|
-
*/
|
|
12
7
|
export declare class Spinner {
|
|
13
8
|
private timer;
|
|
14
9
|
private frame;
|
package/dist/ui/spinner.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧"];
|
|
2
|
-
/**
|
|
3
|
-
* Single-line activity spinner on stderr. Never touches stdout, and never
|
|
4
|
-
* starts at all when stderr is not a TTY or CI is detected: machine modes
|
|
5
|
-
* must see zero bytes from it.
|
|
6
|
-
*/
|
|
7
2
|
export class Spinner {
|
|
8
3
|
timer;
|
|
9
4
|
frame = 0;
|
package/dist/ui/theme.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** Named ANSI color palettes for the CLI output. */
|
|
2
1
|
export interface Theme {
|
|
3
2
|
name: string;
|
|
4
3
|
tag: string;
|
|
@@ -9,14 +8,10 @@ export interface Theme {
|
|
|
9
8
|
progress: string;
|
|
10
9
|
success: string;
|
|
11
10
|
reset: string;
|
|
12
|
-
/** Glyph used for the single-line progress redraw. */
|
|
13
11
|
progressGlyph: string;
|
|
14
|
-
/** Labels use bold instead of color when true (e.g. mono). */
|
|
15
12
|
boldLabels: boolean;
|
|
16
13
|
}
|
|
17
14
|
export declare const THEMES: Record<string, Theme>;
|
|
18
15
|
export declare const THEME_NAMES: string[];
|
|
19
|
-
/** Resolves a theme name; throws with the available names when unknown. */
|
|
20
16
|
export declare function getTheme(name: string | undefined): Theme;
|
|
21
|
-
/** --theme flag wins over TIDEPULL_THEME; neither means the default. */
|
|
22
17
|
export declare function pickTheme(flag: string | undefined, env?: NodeJS.ProcessEnv): Theme;
|
package/dist/ui/theme.js
CHANGED
|
@@ -22,7 +22,6 @@ export const THEMES = {
|
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
export const THEME_NAMES = Object.keys(THEMES);
|
|
25
|
-
/** Resolves a theme name; throws with the available names when unknown. */
|
|
26
25
|
export function getTheme(name) {
|
|
27
26
|
const key = name ?? "tide";
|
|
28
27
|
const t = THEMES[key];
|
|
@@ -30,7 +29,6 @@ export function getTheme(name) {
|
|
|
30
29
|
throw new Error(`Unknown theme "${key}". Available themes: ${THEME_NAMES.join(", ")}`);
|
|
31
30
|
return t;
|
|
32
31
|
}
|
|
33
|
-
/** --theme flag wins over TIDEPULL_THEME; neither means the default. */
|
|
34
32
|
export function pickTheme(flag, env = process.env) {
|
|
35
33
|
return getTheme(flag ?? env.TIDEPULL_THEME);
|
|
36
34
|
}
|
package/package.json
CHANGED