Skip to content

Commit

Permalink
add m3u8 type check
Browse files Browse the repository at this point in the history
  • Loading branch information
Last-Order committed Aug 27, 2021
1 parent 39b5d63 commit d3a235e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minyami",
"version": "4.2.9",
"version": "4.2.10",
"description": "",
"main": "dist/exports.js",
"types": "dist/exports.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions src/core/m3u8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export default class M3U8 {
throw new M3U8ParseError("Missing full url for m3u8.");
}
}
if (line.startsWith("#EXT-X-STREAM-INF")) {
throw new M3U8ParseError("Instead of giving Minyami a master M3U8, please input a playlist.");
}
} else {
// normal video chunk
if (!line) {
Expand Down
1 change: 0 additions & 1 deletion src/utils/m3u8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import axios, { AxiosRequestConfig } from "axios";
import M3U8 from "../core/m3u8";
import ProxyAgentHelper from "../utils/agent";
import logger from "../utils/log";
import UA from "../constants/ua";

export async function loadM3U8(path: string, retries: number = 1, timeout = 60000, options: AxiosRequestConfig = {}) {
const proxyAgent = ProxyAgentHelper.getProxyAgentInstance();
Expand Down

0 comments on commit d3a235e

Please sign in to comment.