Skip to content

Commit 74f63a1

Browse files
committed
fix bugs
1 parent b8df3b6 commit 74f63a1

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minyami",
3-
"version": "4.4.2",
3+
"version": "4.4.3",
44
"description": "",
55
"main": "dist/exports.js",
66
"types": "dist/exports.d.ts",

src/core/downloader.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,14 @@ class Downloader extends EventEmitter {
149149

150150
if (output) {
151151
this.outputPath = output;
152-
if (fs.existsSync(this.outputPath)) {
153-
// output filename conflict
154-
const pathArr = this.outputPath.split(".");
155-
const filePath = pathArr.slice(0, -1).join(".");
156-
const ext = pathArr[pathArr.length - 1];
157-
this.outputPath = `${filePath}_${Date.now()}.${ext}`;
158-
}
152+
}
153+
154+
if (fs.existsSync(this.outputPath)) {
155+
// output filename conflict
156+
const pathArr = this.outputPath.split(".");
157+
const filePath = pathArr.slice(0, -1).join(".");
158+
const ext = pathArr[pathArr.length - 1];
159+
this.outputPath = `${filePath}_${Date.now()}.${ext}`;
159160
}
160161

161162
if (key) {

src/core/m3u8.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ export class Playlist {
169169
}
170170
this.chunks.push({
171171
url: CommonUtils.buildFullUrl(this.m3u8Url, initialSegmentUrl),
172-
isEncrypted: false,
172+
isEncrypted: true,
173173
length: 0,
174174
sequenceId: 0,
175+
key,
176+
iv,
175177
});
176178
}
177179
if (currentLine.startsWith("#EXT-X-ENDLIST")) {

0 commit comments

Comments
 (0)