From b7733179f2c7b64faef868596531608300692ca8 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Mon, 23 Nov 2020 13:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=9B=B4=E6=92=AD=E6=BA=90?= =?UTF-8?q?=E6=97=B6=E5=85=81=E8=AE=B8=E7=BD=91=E5=9D=80=E5=B8=A6=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/IPTV.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index b52944f..ea6b8e9 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -344,12 +344,13 @@ export default { result.filePaths.forEach(file => { if (file.endsWith('m3u') || file.endsWith('m3u8')) { const docs = [] + const URL = require('url') let id = this.channelList.length ? this.channelList.slice(-1)[0].id + 1 : 1 const parser = require('iptv-playlist-parser') const playlist = fs.readFileSync(file, { encoding: 'utf-8' }) const result = parser.parse(playlist) result.items.forEach(ele => { - if (ele.name && ele.url && ele.url.endsWith('.m3u8')) { + if (ele.name && ele.url && new URL.URL(ele.url).pathname.endsWith('.m3u8')) { // 网址可能带参数 var doc = { id: id, name: ele.name,