mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 20:44:52 +08:00
🥗 新增多个下载入口 🥙
This commit is contained in:
@@ -123,7 +123,7 @@ export default {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: n } }
|
||||
} else {
|
||||
this.video = { key: this.detail.key, info: { id: this.detail.info.id, name: this.detail.info.name, index: n } }
|
||||
this.video = { key: this.detail.key, info: { id: this.detail.info.ids, name: this.detail.info.name, index: n } }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = ''
|
||||
let downloadUrl = res.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
@@ -169,7 +169,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
const list = [...this.m3u8List]
|
||||
let downloadUrl = ''
|
||||
let downloadUrl = this.detail.info.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="starEvent(i)">收藏</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -92,6 +93,7 @@
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="starEvent(i)">收藏</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -108,6 +110,7 @@ import { star, history, search, sites } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Waterfall from 'vue-waterfall-plugin'
|
||||
import InfiniteLoading from 'vue-infinite-loading'
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
name: 'film',
|
||||
data () {
|
||||
@@ -181,6 +184,12 @@ export default {
|
||||
},
|
||||
searchTxt () {
|
||||
this.searchChangeEvent()
|
||||
},
|
||||
setting: {
|
||||
handler () {
|
||||
this.settingChangeEvent()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -312,6 +321,34 @@ export default {
|
||||
info: e
|
||||
}
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(this.site.key, e.id).then(res => {
|
||||
if (res) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = res.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
const list = [...this.m3u8List]
|
||||
let downloadUrl = e.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
}
|
||||
})
|
||||
},
|
||||
changeView () {
|
||||
if (this.view === 'Film') {
|
||||
this.$refs.waterfall.refresh()
|
||||
@@ -400,10 +437,12 @@ export default {
|
||||
this.site = this.sites[0]
|
||||
this.siteClick(this.site)
|
||||
})
|
||||
},
|
||||
settingChangeEvent () {
|
||||
this.getAllsites()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getAllsites()
|
||||
this.getAllSearch()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,6 +206,8 @@ export default {
|
||||
sites.add(json).then(e => {
|
||||
this.$message.success('已添加成功')
|
||||
this.getSites()
|
||||
this.d.site = json[0].key
|
||||
this.setting = this.d
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -247,7 +249,9 @@ export default {
|
||||
win.destroy()
|
||||
})
|
||||
},
|
||||
openDoc (e) {}
|
||||
openDoc (e) {
|
||||
this.$message.info('文档还在整理中, 请耐心等待~')
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getSetting()
|
||||
|
||||
Reference in New Issue
Block a user