🍚 修复列表模式下, 下载BUG 🍜

This commit is contained in:
hunlongyu
2020-07-14 16:35:51 +08:00
parent 6f8f700dfc
commit 0555badcfa
2 changed files with 15 additions and 4 deletions

View File

@@ -322,7 +322,7 @@ export default {
},
downloadEvent (e) {
zy.download(this.site.key, e.id).then(res => {
if (res) {
if (res.length > 0) {
const text = res.dl.dd._t
if (text) {
const list = text.split('#')
@@ -337,9 +337,20 @@ export default {
this.$message.warning('没有查询到下载链接.')
}
} else {
const list = [...this.m3u8List]
let m3u8List = []
const dd = e.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('#')
}
let downloadUrl = e.name + '\n'
for (const i of list) {
for (const i of m3u8List) {
const url = encodeURI(i.split('$')[1])
downloadUrl += (url + '\n')
}

View File

@@ -184,7 +184,7 @@ const zy = {
reject(err)
})
} else {
resolve(null)
resolve([])
}
})
})