diff --git a/package-lock.json b/package-lock.json index caf44da..f1812dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "minyami", - "version": "4.4.2", + "version": "4.4.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "minyami", - "version": "4.4.2", + "version": "4.4.3", "license": "GPL-3.0-or-later", "dependencies": { "@eridanussora/reconnecting-websocket": "^4.4.2", diff --git a/package.json b/package.json index 57daf38..27b6981 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minyami", - "version": "4.4.2", + "version": "4.4.3", "description": "", "main": "dist/exports.js", "types": "dist/exports.d.ts", diff --git a/src/core/downloader.ts b/src/core/downloader.ts index e7e56f3..f6fb3d9 100644 --- a/src/core/downloader.ts +++ b/src/core/downloader.ts @@ -149,13 +149,14 @@ class Downloader extends EventEmitter { if (output) { this.outputPath = output; - if (fs.existsSync(this.outputPath)) { - // output filename conflict - const pathArr = this.outputPath.split("."); - const filePath = pathArr.slice(0, -1).join("."); - const ext = pathArr[pathArr.length - 1]; - this.outputPath = `${filePath}_${Date.now()}.${ext}`; - } + } + + if (fs.existsSync(this.outputPath)) { + // output filename conflict + const pathArr = this.outputPath.split("."); + const filePath = pathArr.slice(0, -1).join("."); + const ext = pathArr[pathArr.length - 1]; + this.outputPath = `${filePath}_${Date.now()}.${ext}`; } if (key) { diff --git a/src/core/m3u8.ts b/src/core/m3u8.ts index 8315b85..34e0aea 100644 --- a/src/core/m3u8.ts +++ b/src/core/m3u8.ts @@ -169,9 +169,11 @@ export class Playlist { } this.chunks.push({ url: CommonUtils.buildFullUrl(this.m3u8Url, initialSegmentUrl), - isEncrypted: false, + isEncrypted: true, length: 0, sequenceId: 0, + key, + iv, }); } if (currentLine.startsWith("#EXT-X-ENDLIST")) {