diff --git a/index.js b/index.js index bdfe985..7993188 100644 --- a/index.js +++ b/index.js @@ -114,6 +114,13 @@ function getMimeFromUrl(u) { return 'image/jpeg'; } +/** + * 创建m3u8文件, 并返回 m3u8 路径, 如任务正在进行中则返回原视频 mp4 路径 + */ +async function createM3u8Task(contentPath, apiData) { + +} + /** * 生成缩略图并缓存 * @param {*} reply @@ -372,8 +379,6 @@ async function downloadAndServe(reply, apiData, contentPath, key) { }); } - - if (task.done && fs.existsSync(contentPath)) { console.log('Download completed:', key); if (isValidThumbSpec(apiData.data.thumb)) { @@ -382,12 +387,10 @@ async function downloadAndServe(reply, apiData, contentPath, key) { return serveCompletedCache(reply, apiData, contentPath);//reply, apiData, contentPath } - console.log('Downloading:', key); if (isValidThumbSpec(apiData.data.thumb)) { return generateThumbAndCache(reply, apiData, contentPath).catch(() => { }); } - // Serve growing file return serveGrowingFile(reply, task, apiData); }