Skip to content

Commit

Permalink
Merge pull request #133 from fireattack/master
Browse files Browse the repository at this point in the history
Warn only once per m3u8
  • Loading branch information
Last-Order authored Jul 19, 2024
2 parents 25f9dfe + 1d8678b commit 973566d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/m3u8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export class Playlist {
private parse() {
let key: string,
iv: string,
isEncrypted = false;
isEncrypted = false,
warned = false;
const lines = this.m3u8Content.split("\n");
for (let i = 0; i <= lines.length - 1; i++) {
/**
Expand Down Expand Up @@ -195,9 +196,12 @@ export class Playlist {
isEncrypted = false;
} else {
isEncrypted = false;
logger.warning(
`Unsupported encryption method: "${parsedTagBody["METHOD"]}". Chunks will not be decrypted.`
);
if (!warned) {
logger.warning(
`Unsupported encryption method: "${parsedTagBody["METHOD"]}". Chunks will not be decrypted.`
);
warned = true;
}
}
}
if (currentLine.startsWith("#EXT-X-MAP")) {
Expand Down

0 comments on commit 973566d

Please sign in to comment.