| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- // @ts-check
- // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
- // This file is automatically generated. DO NOT EDIT
- /**
- * YTDLPService 是「视频下载」功能的 Wails 服务。
- * @module
- */
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore: Unused imports
- import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore: Unused imports
- import * as $models from "./models.js";
- /**
- * Available 检测 PATH 中是否存在 yt-dlp,并返回其路径与版本。
- * @returns {$CancellablePromise<$models.YTDLPInfo>}
- */
- export function Available() {
- return $Call.ByID(1705936597).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType0($result);
- }));
- }
- /**
- * FetchTitle 用 yt-dlp 解析视频标题(不下载),供工具列表显示。
- * 解析失败(网络/链接失效等)返回空字符串,由前端回退显示链接。
- * @param {string} url
- * @returns {$CancellablePromise<string>}
- */
- export function FetchTitle(url) {
- return $Call.ByID(1795836596, url);
- }
- /**
- * GetConfig 读取当前下载配置(每次从设置文件读取,保证与设置页保存结果一致)。
- * @returns {$CancellablePromise<$models.YTDLPConfig>}
- */
- export function GetConfig() {
- return $Call.ByID(1661667492).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType1($result);
- }));
- }
- /**
- * StartDownload 开始下载视频:yt-dlp --newline [-P <目录>] [-x --audio-format mp3] -o "%(title)s.%(ext)s" <url>。
- * audioOnly 为 true 时下载并转换为 mp3(需要 ffmpeg)。
- * 日志与退出状态分别通过 ytdlp:log / ytdlp:exit 事件推送。
- * @param {string} url
- * @param {boolean} audioOnly
- * @returns {$CancellablePromise<void>}
- */
- export function StartDownload(url, audioOnly) {
- return $Call.ByID(1529748726, url, audioOnly);
- }
- /**
- * StopDownload 终止下载任务(若在运行)。
- * @returns {$CancellablePromise<void>}
- */
- export function StopDownload() {
- return $Call.ByID(2755176414);
- }
- // Private type creation functions
- const $$createType0 = $models.YTDLPInfo.createFrom;
- const $$createType1 = $models.YTDLPConfig.createFrom;
|