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')))) } ) }