From 51208892d02b2adf1190824f588af68e6106bdc5 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Mon, 18 Jan 2021 21:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dzy.detail=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=88=B0=E7=9A=84=E9=93=BE=E6=8E=A5=E4=B8=8D=E5=8C=85=E5=90=AB?= =?UTF-8?q?"$"=E6=97=B6=E4=BA=A7=E7=94=9F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail.vue | 12 ++++++++---- src/components/Play.vue | 4 ++-- src/lib/site/tools.js | 9 ++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/Detail.vue b/src/components/Detail.vue index 022c9a6..e48d0da 100644 --- a/src/components/Detail.vue +++ b/src/components/Detail.vue @@ -61,7 +61,7 @@
- {{i | ftName}} + {{ i | ftName(j) }}
@@ -93,9 +93,13 @@ export default { } }, filters: { - ftName (e) { - const name = e.split('$')[0] - return name + ftName (e, n) { + const num = e.split('$') + if (num.length > 1) { + return e.split('$')[0] + } else { + return `第${(n + 1)}集` + } } }, computed: { diff --git a/src/components/Play.vue b/src/components/Play.vue index 605be94..6a6613f 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -640,8 +640,8 @@ export default { playlist = fullList.find(x => x.flag === videoFlag).list } this.right.list = playlist - const url = playlist[index].split('$')[1] - if (playlist.every(e => e.split('$')[1].endsWith('.m3u8'))) this.exportablePlaylist = true + const url = playlist[index].includes('$') ? playlist[index].split('$')[1] : playlist[index] + if (playlist.every(e => e.endsWith('.m3u8') || e.split('$')[1].endsWith('.m3u8'))) this.exportablePlaylist = true if (!url.endsWith('.m3u8') && !url.endsWith('.mp4')) { const currentSite = await sites.find({ key: this.video.key }) this.$message.info('即将调用解析接口播放,请等待...') diff --git a/src/lib/site/tools.js b/src/lib/site/tools.js index 68b0cca..bb8e565 100644 --- a/src/lib/site/tools.js +++ b/src/lib/site/tools.js @@ -253,7 +253,10 @@ const zy = { const type = Object.prototype.toString.call(dd) if (type === '[object Array]') { for (const i of dd) { - const ext = Array.from(new Set(...i._t.split('#').map(e => e.split('$')[1].match(/\.\w+?$/)))).map(e => e.slice(1)) + const ext = Array.from(new Set(...i._t.split('#').map(e => { + const itemUrl = e.includes('$') ? e.split('$')[1] : e + return itemUrl.match(/\.\w+?$/) + }))).map(e => e.slice(1)) if (ext.length && ext.length <= supportedFormats.length && ext.every(e => supportedFormats.includes(e))) { if (ext.length === 1) { i._flag = ext[0] @@ -265,7 +268,7 @@ const zy = { fullList.push( { flag: i._flag, - list: i._t.split('#').filter(e => e && e.split('$')[1] && e.split('$')[1].startsWith('http')) + list: i._t.split('#').filter(e => e && (e.startsWith('http') || (e.split('$')[1] && e.split('$')[1].startsWith('http')))) } ) } @@ -273,7 +276,7 @@ const zy = { fullList.push( { flag: dd._flag, - list: dd._t.split('#').filter(e => e && e.split('$')[1] && e.split('$')[1].startsWith('http')) + list: dd._t.split('#').filter(e => e && (e.startsWith('http') || (e.split('$')[1] && e.split('$')[1].startsWith('http')))) } ) }