From 511820f873dba0ff0a9439bb5263a233ef01b4a6 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Thu, 27 Aug 2020 17:01:22 +0200 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E9=87=8C=E7=9A=84=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/History.vue | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/components/History.vue b/src/components/History.vue index 6ab63c2..2f4e32f 100644 --- a/src/components/History.vue +++ b/src/components/History.vue @@ -124,14 +124,28 @@ export default { this.$message.warning('没有查询到下载链接.') } } else { - const list = [...this.m3u8List] - let downloadUrl = '' - for (const i of list) { - const url = encodeURI(i.split('$')[1]) - downloadUrl += (url + '\n') - } - clipboard.writeText(downloadUrl) - this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!') + var m3u8List = {} + zy.detail(e.site, e.ids).then(res => { + const dd = res.dl.dd + const type = Object.prototype.toString.call(dd) + if (type === '[object Array]') { + for (const i of dd) { + if (i._flag.indexOf('m3u8') >= 0) { + m3u8List = i._t.split('#') + } + } + } else { + m3u8List = dd._t.split('#') + } + const list = [...m3u8List] + let downloadUrl = '' + for (const i of list) { + const url = encodeURI(i.split('$')[1]) + downloadUrl += (url + '\n') + } + clipboard.writeText(downloadUrl) + this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!') + }) } }) },