From c623533271ca68c6462b367638d52b8dd0fb4365 Mon Sep 17 00:00:00 2001 From: hectorqin Date: Sat, 1 Aug 2020 22:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dm3u8=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=97=AE=E9=A2=98,=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.js | 3 +++ src/components/Play.vue | 7 +++++-- src/mini/Mini.vue | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/background.js b/src/background.js index a4fc2a3..c53c170 100644 --- a/src/background.js +++ b/src/background.js @@ -6,6 +6,9 @@ import { createProtocol } from 'vue-cli-plugin-electron-builder/lib' import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer' const isDevelopment = process.env.NODE_ENV !== 'production' +// 允许跨域 +app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') + let win let mini diff --git a/src/components/Play.vue b/src/components/Play.vue index 5fe27dc..1945a91 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -382,6 +382,7 @@ export default { return } zy.detail(this.video.key, this.video.info.id).then(res => { + window.console.log(res) this.name = res.name const dd = res.dl.dd const type = Object.prototype.toString.call(dd) @@ -401,8 +402,9 @@ export default { const j = i.split('$') if (j.length > 1) { for (let m = 0; m < j.length; m++) { - if (j[m].indexOf('m3u8') >= 0) { + if (j[m].indexOf('.m3u8') >= 0 && j[m].startsWith('http')) { m3u8Arr.push(j[m]) + break } } } else { @@ -595,8 +597,9 @@ export default { let link, name if (j.length > 1) { for (let m = 0; m < j.length; m++) { - if (j[m].indexOf('m3u8') >= 0) { + if (j[m].indexOf('.m3u8') >= 0 && j[m].startsWith('http')) { link = j[m] + break } } name = j[0] diff --git a/src/mini/Mini.vue b/src/mini/Mini.vue index 565c271..cf8d178 100644 --- a/src/mini/Mini.vue +++ b/src/mini/Mini.vue @@ -22,15 +22,15 @@ 播放进度: {{progress}}%
+ + + - - -