diff --git a/package.json b/package.json index fc18011..66f87a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zy", - "version": "1.0.1", + "version": "1.0.4", "private": true, "author": { "name": "Hunlongyu", diff --git a/src/assets/scss/style.scss b/src/assets/scss/style.scss index 5aa9119..a70cf0a 100644 --- a/src/assets/scss/style.scss +++ b/src/assets/scss/style.scss @@ -93,7 +93,7 @@ width: 120px; } &.operate{ - width: 120px; + width: 170px; } } } @@ -133,7 +133,7 @@ width: 120px; } &.operate{ - width: 120px; + width: 170px; } } } diff --git a/src/background.js b/src/background.js index f335a70..01f7cfe 100644 --- a/src/background.js +++ b/src/background.js @@ -8,6 +8,7 @@ import { import path from 'path' import { autoUpdater } from 'electron-updater' const isDevelopment = process.env.NODE_ENV !== 'production' +const globalShortcut = require('electron').globalShortcut let win let mini @@ -20,7 +21,7 @@ function createWindow () { width: 1080, height: 720, frame: false, - resizable: false, + resizable: true, transparent: true, webPreferences: { webSecurity: false, @@ -126,6 +127,32 @@ if (!gotTheLock) { // 创建 win, 加载应用的其余部分, etc... app.on('ready', () => { + globalShortcut.register('CommandOrControl+right', function () { + if (win) { + win.webContents.send('next', 0) + } + if (mini) { + mini.webContents.send('next', 0) + } + }) + globalShortcut.register('CommandOrControl+left', function () { + if (win) { + win.webContents.send('prev', 0) + } + if (mini) { + mini.webContents.send('prev', 0) + } + }) + globalShortcut.register('CommandOrControl+up', function () { + if (mini) { + mini.webContents.send('up', 0) + } + }) + globalShortcut.register('CommandOrControl+down', function () { + if (mini) { + mini.webContents.send('down', 0) + } + }) if (!process.env.WEBPACK_DEV_SERVER_URL) { createProtocol('app') } diff --git a/src/components/Film.vue b/src/components/Film.vue index 5a5db84..8e24b15 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -59,6 +59,7 @@ {{$t('play')}} {{$t('star')}} {{$t('share')}} + {{$t('download')}} @@ -80,6 +81,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' +const { clipboard } = require('electron') export default { name: 'film', data () { @@ -261,6 +263,33 @@ export default { v: e } }, + downloadEvent (e) { + tools.detail_get(e.site, e.detail).then(res => { + if (res.mp4_urls.length > 0) { + const urls = [...res.mp4_urls] + let txt = `${e.name}\n` + for (const i of urls) { + const name = i.split('$')[0] + const url = encodeURI(i.split('$')[1]) + txt += (name + ': ' + url + '\n') + } + clipboard.writeText(txt) + this.$m.success('〖MP4〗: ' + this.$t('copy_success')) + return false + } + if (res.m3u8_urls.length > 0) { + const urls = [...res.m3u8_urls] + let txt = `${e.name}\n` + for (const i of urls) { + const name = i.split('$')[0] + const url = encodeURI(i.split('$')[1]) + txt += (name + ': ' + url + '\n') + } + clipboard.writeText(txt) + this.$m.success('〖M3U8〗: ' + this.$t('copy_success')) + } + }) + }, tbPageChange (e) { this.tb.loading = true this.tb.page = e @@ -277,7 +306,7 @@ export default {