@lzwme/m3u8-dl
Version:
A free, open-source, and powerful m3u8 video batch downloader with multi-threaded downloading, play-while-downloading, WebUI management, video parsing, and more.
23 lines (22 loc) • 1.19 kB
TypeScript
import { type Stats } from 'node:fs';
import type { OutgoingHttpHeaders } from 'node:http';
import { NLogger, Request } from '@lzwme/fe-utils';
export declare const request: Request;
export declare const getRetry: <T = string>(url: string, headers?: OutgoingHttpHeaders | string, retries?: number) => Promise<{
data: T;
buffer: Buffer;
headers: import("node:http").IncomingHttpHeaders;
response: import("node:http").IncomingMessage;
}>;
export declare const logger: NLogger;
export declare function isSupportFfmpeg(ffmpegBin: string): boolean;
export declare function findFiles(apidir?: string, validate?: (filepath: string, stat: Stats) => boolean): string[];
/** 获取重定向后的 URL */
export declare function getLocation(url: string, method?: string): Promise<string>;
/**
* 将传入的 headers 转换为统一的小写键对象格式
* 如果 headers 是字符串,会先将其解析为对象;如果 headers 为空,则返回空对象。
*/
export declare function formatHeaders(headers: string | OutgoingHttpHeaders): Record<string, string>;
/** 异步检查文件是否存在 */
export declare function checkFileExists(filepath: string): Promise<boolean>;