UNPKG

@lzwme/m3u8-dl

Version:

Batch download of m3u8 files and convert to mp4

21 lines (20 loc) 1.05 kB
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("http").IncomingHttpHeaders; response: import("http").IncomingMessage; }>; export declare const logger: NLogger; export declare function isSupportFfmpeg(): 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>;