diff --git a/README.md b/README.md index 1b9a749..001ca80 100644 --- a/README.md +++ b/README.md @@ -29,18 +29,20 @@ 3. 新增历史播放记录, 并记录播放进度 4. 新增分享功能. 一键分享海报图片 5. 新增精简模式. 支持修改透明度 -6. 全新布局配色 -7. 新增多语言 -8. 下载功能 -9. 更详细的视频分类 -10. 收藏夹同步更新视频追剧 -11. 后台自动更新 +6. 收藏夹同步更新视频追剧 +7. 支持演员名称搜索 +8. 更详细的视频分类 +9. 后台自动更新 +10. 全新布局配色 +11. 新增多语言 12. 全局快捷键 -13. 支持演员名称搜索 +13. 下载功能 14. ... 觉得软件不错的, 点击右上角 star 收藏关注一波呀~ +> Tips: 资源加载不出来时, 点击列表下方链接, 浏览器打开一下网站. 原理是需要通过网站的人机检测. + #### 全局快捷键: | 快捷键 | 说明 | 主界面 | 小窗口 | diff --git a/package.json b/package.json index b5e5390..2ac6206 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zy", - "version": "1.0.11", + "version": "1.0.12", "private": true, "author": { "name": "Hunlongyu", diff --git a/src/components/Film.vue b/src/components/Film.vue index fe2c2cc..518c88c 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -69,7 +69,7 @@
今日更新: {{ tb.update }} 条 - 前往该资源网 + 加载不出来,点这里
diff --git a/src/components/Play.vue b/src/components/Play.vue index d3be6fa..7b956c2 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -210,44 +210,48 @@ export default { this.xg.pause() } this.changeVideo() - tools.detail_get(this.video.site, this.video.detail).then(res => { - this.name = this.video.name - this.right.listData = res.m3u8_urls - if (res.m3u8_urls.length > 1) { - const m3 = res.m3u8_urls + history.find({ detail: this.video.detail }).then(item => { + let index = 1 + let time = 0 + if (item) { + index = item.index + if (this.video.index === index) { + time = item.currentTime + } + } + tools.detail_get(this.video.site, this.video.detail).then(res => { + this.name = this.video.name + this.right.listData = res.m3u8_urls + + const m = res.m3u8_urls const arr = [] - for (const i of m3) { + for (const i of m) { arr.push(i.split('$')[1]) } this.length = arr.length - this.xg.src = arr[this.video.index] - this.showNext = true - } else { - const link = res.m3u8_urls[this.video.index] - const src = link.split('$')[1] - this.length = 1 - this.xg.src = src - this.showNext = false - } - const currentTime = this.video.currentTime - if (currentTime !== '') { - this.xg.play() - this.xg.once('playing', () => { - this.xg.currentTime = currentTime - }) - } else { - this.xg.play() - } - this.xg.once('play', () => { - this.mask = false - }) - this.onPlayVideo() - this.xg.once('ended', () => { - if (res.m3u8_urls.length > 1 && (res.m3u8_urls.length - 1 > this.video.index)) { - this.video.currentTime = 0 - this.video.index++ + this.xg.src = arr[index] + this.showNext = this.length > 1 + + const currentTime = time + if (currentTime !== 0) { + this.xg.play() + this.xg.once('playing', () => { + this.xg.currentTime = currentTime + }) + } else { + this.xg.play() } - this.xg.off('ended') + this.xg.once('play', () => { + this.mask = false + }) + this.onPlayVideo() + this.xg.once('ended', () => { + if (res.m3u8_urls.length > 1 && (res.m3u8_urls.length - 1 > this.video.index)) { + this.video.currentTime = 0 + this.video.index++ + } + this.xg.off('ended') + }) }) }) }, @@ -296,6 +300,14 @@ export default { history.update(res.id, h) } }) + video.find({ detail: d }).then(res => { + if (res) { + const h = { ...this.video } + delete h.id + delete h.currentTime + video.update(res.id, h) + } + }) }, 10000) }, closeEvent () { diff --git a/src/lib/cloud/index.js b/src/lib/cloud/index.js index c523626..eaf2802 100644 --- a/src/lib/cloud/index.js +++ b/src/lib/cloud/index.js @@ -1,32 +1,43 @@ -import setting from '../dexie/setting' - const os = require('os') -const macadress = require('macaddress') +const macaddress = require('macaddress') const AV = require('leancloud-storage') -setting.find().then(res => { - const cloud = res.cloud - if (!cloud) { - macadress.one((err, mac) => { - if (err) { - return false - } - const system = os.hostname() + ' ' + os.type() + ' ' + os.arch() - AV.init({ - appId: 'X6TRIcMjgOG7EJ0t1l5r9In1-gzGzoHsz', - appKey: 'JmkGF9UqkWGQNYDcJ2g1QV1b', - serverURL: 'https://x6tricmj.lc-cn-n1-shared.com' - }) +macaddress.one((err, mac) => { + if (err) { + return false + } + AV.init({ + appId: 'X6TRIcMjgOG7EJ0t1l5r9In1-gzGzoHsz', + appKey: 'JmkGF9UqkWGQNYDcJ2g1QV1b', + serverURL: 'https://x6tricmj.lc-cn-n1-shared.com' + }) + const system = os.hostname() + ' ' + os.type() + ' ' + os.arch() + const query = new AV.Query('ZYPlayer') + query.equalTo('os', system) + query.equalTo('mac', mac) + query.find().then(res => { + // 存储新用户数据 + if (res.length === 0) { const ZYPlayer = AV.Object.extend('ZYPlayer') const zyPlayer = new ZYPlayer() zyPlayer.set('os', system) zyPlayer.set('mac', mac) - zyPlayer.save().then(e => { - const id = e.id - res.cloud = true - res.cloudKey = id - setting.update(res) - }) - }) - } + zyPlayer.save() + return false + } + // 统计启动次数 + if (res.length === 1) { + const id = res[0].id + const times = AV.Object.createWithoutData('ZYPlayer', id) + times.increment('times', 1) + times.save() + return false + } + // 清除冗余数据 + if (res.length > 1) { + const arr = res + arr.shift() + AV.Object.destroyAll(arr) + } + }) })