From af6dcb11bfbd85bfbd30c94d193f88f482efc0e9 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Thu, 27 Aug 2020 16:53:02 +0200 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=A7=E9=9B=86=E7=9A=84?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Share.vue | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/Share.vue b/src/components/Share.vue index 4d17e89..0491824 100644 --- a/src/components/Share.vue +++ b/src/components/Share.vue @@ -70,16 +70,22 @@ export default { zy.detail(this.share.key, id).then(res => { if (res) { this.pic = res.pic - const text = res.dl.dd - for (const i of text) { - if (i._flag.indexOf('m3u8') >= 0) { - const arr = i._t.split('#') - const url = arr[0].split('$')[1] - this.link = 'http://zyplayer.fun/player/player.html?url=' + url + '&title=' + this.share.info.name + var m3u8List = {} + 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('#') } - this.loading = false + const url = m3u8List[1] + this.link = 'http://zyplayer.fun/player/player.html?url=' + url + '&title=' + this.share.info.name } + this.loading = false }) }, picLoadEvent () {