Compare commits

...

11 Commits

Author SHA1 Message Date
hunlongyu
0e571efd6f 😑 日常写BUG, 改BUG 2020-05-31 13:40:34 +08:00
hunlongyu
79adbd1f81 😑 日常写BUG, 改BUG 2020-05-30 16:14:26 +08:00
hunlongyu
214a267ba5 😥 紧急修复bug 2020-05-29 14:29:53 +08:00
hunlongyu
7aee9b9fbe 😅 解决收藏夹点击播放,没有历史记录的问题 2020-05-29 11:52:09 +08:00
hunlongyu
010b488340 😋 修复精简模式下切换视频无法保留历史记录的问题 2020-05-27 09:49:56 +08:00
hunlongyu
03c32d8ee2 😥 修改说明文字 2020-05-25 22:32:38 +08:00
hunlongyu
203d2c19fd 😂 Mini 窗口支持倍速快捷键 2020-05-25 22:31:10 +08:00
hunlongyu
0ed25643fc 😅 升级依赖 2020-05-25 22:04:18 +08:00
hunlongyu
ba99e65bcb 😅 新增快捷键视频倍速 2020-05-25 22:00:23 +08:00
hunlongyu
169b28ab33 💦 播放速度 2020-05-25 18:23:03 +08:00
hunlongyu
cbcffd7587 😣x86 fail 2020-05-24 14:57:39 +08:00
13 changed files with 198 additions and 10326 deletions

View File

@@ -25,11 +25,3 @@ jobs:
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
dist_electron/win-unpacked/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -24,32 +24,35 @@
## ZY Player 资源播放器
1. 全平台支持. windows, mac, linux.
2. 12个视频源. 未来更新更多的视频源.
3. 新增历史播放记录, 并记录播放进度.
4. 新增分享功能. 一键分享海报图片.
5. 新增精简模式. 支持修改透明度.
6. 全新布局配色.
7. 新增多语言.
8. 下载功能 (最大资源网和OK资源网支持下载.)
9. 更详细的视频分类
10. 收藏夹同步更新视频追剧.(手动更新)
11. 后台自动更
1. 全平台支持. Windows, Mac, Linux
2. 12个视频源. 未来更新更多的视频源
3. 新增历史播放记录, 并记录播放进度
4. 新增分享功能. 一键分享海报图片
5. 新增精简模式. 支持修改透明度
6. 收藏夹同步更新视频追剧
7. 支持演员名称搜索
8. 更详细的视频分类
9. 后台自动更新
10. 全新布局配色
11.增多语言
12. 全局快捷键
13. 支持演员名称搜索
13. 下载功能
14. ...
觉得软件不错的, 点击右上角 star 收藏关注一波呀~
> Tips: 资源加载不出来时, 点击列表下方链接, 浏览器打开一下网站. 原理是需要通过网站的人机检测.
#### 全局快捷键:
| 快捷键 | 说明 | 主界面 | 小窗口 |
| :----------------------: | ---------- | :----: | :----: |
| `⌘ + ``Ctrl + ` | 下一集 | √ | √ |
| `⌘ + ``Ctrl + ` | 上一集 | √ | √ |
| `⌘ + ``Ctrl + ` | 减少透明度 | | √ |
| `⌘ + ``Ctrl + ` | 增加透明度 | | √ |
| `⌘ + ``Ctrl + ` | 下一集 | √ | √ |
| `⌘ + ``Ctrl + ` | 上一集 | √ | √ |
| `⌘ + ``Ctrl + ` | 减少透明度 | | √ |
| `⌘ + ``Ctrl + ` | 增加透明度 | | √ |
| `Shift + ↑` | 增加倍速 + 0.25 | √ | √ |
| `Shift + ↓` | 减少倍速 - 0.25 | √ | √ |
#### 下载:

View File

@@ -1,6 +1,6 @@
{
"name": "zy",
"version": "1.0.6",
"version": "1.0.15",
"private": true,
"author": {
"name": "Hunlongyu",
@@ -16,24 +16,25 @@
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
"electron:generate-icons": "electron-icon-builder --input=./public/icon.png --output=build --flatten",
"release": "vue-cli-service electron:build -p always"
"release": "vue-cli-service electron:build -p always",
"dist": "vue-cli-service electron:build --win --ia32"
},
"main": "background.js",
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.5",
"dexie": "^2.0.4",
"electron-updater": "^4.2.5",
"element-ui": "^2.13.1",
"electron-updater": "^4.3.1",
"element-ui": "^2.13.2",
"html2canvas": "^1.0.0-rc.5",
"leancloud-storage": "^4.5.3",
"macaddress": "^0.2.9",
"macaddress": "^0.5.1",
"modern-normalize": "^0.6.0",
"qrcode.vue": "^1.7.0",
"vue": "^2.6.11",
"vue-i18n": "^8.17.0",
"vuex": "^3.1.3",
"xgplayer": "^2.6.24",
"vue-i18n": "^8.17.7",
"vuex": "^3.4.0",
"xgplayer": "^2.7.1",
"xgplayer-hls.js": "^2.2.2"
},
"devDependencies": {
@@ -44,7 +45,7 @@
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"electron": "^8.3.0",
"electron": "^9.0.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",

View File

@@ -151,6 +151,9 @@
padding-left: 10px;
font-size: 12px;
}
.btn{
cursor: pointer;
}
}
}

View File

@@ -75,7 +75,10 @@ function createMini () {
}
app.allowRendererProcessReuse = true
app.commandLine.appendSwitch('--no-sandbox')
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors')
if (process.platform === 'Linux') {
app.disableHardwareAcceleration()
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
@@ -154,6 +157,22 @@ if (!gotTheLock) {
mini.webContents.send('down', 0)
}
})
globalShortcut.register('shift+up', function () {
if (win) {
win.webContents.send('playbackRateUp', 0)
}
if (mini) {
mini.webContents.send('playbackRateUp', 0)
}
})
globalShortcut.register('shift+down', function () {
if (win) {
win.webContents.send('playbackRateDown', 0)
}
if (mini) {
mini.webContents.send('playbackRateDown', 0)
}
})
if (!process.env.WEBPACK_DEV_SERVER_URL) {
createProtocol('app')
}

View File

@@ -299,7 +299,7 @@ export default {
top: 50px;
left: 0;
width: 100%;
height: calc(100 - 50px);
height: calc(100% - 50px);
display: flex;
justify-content: center;
align-items: center;

View File

@@ -69,6 +69,7 @@
</div>
<div class="tFooter">
<span class="tFooter-span">今日更新: {{ tb.update }} </span>
<span class="tFooter-span btn" @click="goWebsite">加载不出来,点这里</span>
<el-pagination small :page-size="tb.size" :total="tb.total" :current-page="tb.page" @current-change="tbPageChange" layout="total, prev, pager, next, jumper"></el-pagination>
</div>
</div>
@@ -81,6 +82,7 @@ import { sites, getSite } from '../lib/site/sites'
import tools from '../lib/site/tools'
import video from '../lib/dexie/video'
import setting from '../lib/dexie/setting'
import { shell } from 'electron'
const { clipboard } = require('electron')
export default {
name: 'film',
@@ -297,6 +299,9 @@ export default {
this.tb.list = res.list
this.tb.loading = false
})
},
goWebsite () {
shell.openExternal(this.site.url)
}
},
created () {

View File

@@ -191,11 +191,11 @@ export default {
this.right.show = false
this.right.type = ''
},
video: {
handler () {
this.getUrls()
},
deep: true
'video.index' () {
this.getUrls()
},
'video.detail' () {
this.getUrls()
}
},
methods: {
@@ -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 = 0
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 () {
@@ -303,21 +315,17 @@ export default {
this.right.type = ''
},
nextEvent () {
const v = { ...this.video }
const i = v.index + 1
if (i < this.right.listData.length) {
this.video.currentTime = 0
if (this.video.index < this.right.listData.length - 1) {
this.video.index++
this.video.currentTime = 0
} else {
this.$m.warning(this.$t('last_video'))
}
},
prevEvent () {
const v = { ...this.video }
const i = v.index - 1
if (i > 0) {
this.video.currentTime = 0
if (this.video.index > 0) {
this.video.index--
this.video.currentTime = 0
} else {
this.$m.warning(this.$t('first_video'))
}
@@ -411,6 +419,14 @@ export default {
this.right.historyData = e.reverse()
})
})
},
playbackRateEvent (e) {
let rate = this.xg.playbackRate
if (rate > 0.25) {
rate = rate + e
this.xg.playbackRate = rate
this.$m.success(this.$t('rate') + rate)
}
}
},
mounted () {
@@ -432,6 +448,20 @@ export default {
}
}
})
ipc.on('playbackRateUp', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(0.25)
}
}
})
ipc.on('playbackRateDown', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(-0.25)
}
}
})
}
}
</script>

View File

@@ -1,32 +1,44 @@
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.set('times', 1)
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)
}
})
})

View File

@@ -47,5 +47,6 @@
"async_success": "Synchronization succeeded, update found.",
"no_history": "No history data.",
"clearDB": "Reset software",
"clearTips": "Click to clear the database and close the software"
"clearTips": "Click to clear the database and close the software",
"rate": "The current video speed is: "
}

View File

@@ -47,5 +47,6 @@
"async_success": "同步成功, 查询到更新。",
"no_history": "无历史记录",
"clearDB": "重置软件",
"clearTips": "软件没有问题,请勿重置软件,否则数据丢失概不负责.点击即清空数据库,并关闭软件."
"clearTips": "软件没有问题,请勿重置软件,否则数据丢失概不负责.点击即清空数据库,并关闭软件.",
"rate": "当前视频播放倍速为:"
}

View File

@@ -92,6 +92,7 @@ export default {
this.xg.on('ended', () => {
if (this.d.m3u8_urls.length > 1 && (this.d.m3u8_urls.length - 1 > this.index)) {
this.video.currentTime = 0
this.video.index++
this.index++
let src = this.d.m3u8_urls[this.index]
src = src.split('$')[1]
@@ -122,6 +123,7 @@ export default {
if (res) {
const v = res
v.currentTime = this.xg.currentTime
v.index = this.index
const id = v.id
delete v.id
history.update(id, v)
@@ -162,6 +164,13 @@ export default {
this.index++
})
})
},
playbackRateEvent (e) {
let rate = this.xg.playbackRate
if (rate > 0.25) {
rate = rate + e
this.xg.playbackRate = rate
}
}
},
created () {
@@ -195,6 +204,20 @@ export default {
this.opacityChange(this.opacity)
}
})
ipc.on('playbackRateUp', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(0.25)
}
}
})
ipc.on('playbackRateDown', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(-0.25)
}
}
})
}
}
</script>

10218
yarn.lock

File diff suppressed because it is too large Load Diff