diff --git a/.electron-vue/webpack.renderer.config.js b/.electron-vue/webpack.renderer.config.js index e95ac70..282d98d 100644 --- a/.electron-vue/webpack.renderer.config.js +++ b/.electron-vue/webpack.renderer.config.js @@ -145,6 +145,7 @@ let rendererConfig = { resolve: { alias: { '@': path.join(__dirname, '../src/renderer'), + '~': path.join(__dirname, '../'), 'vue$': 'vue/dist/vue.esm.js' }, extensions: ['.js', '.vue', '.json', '.css', '.node'] diff --git a/build/icons/icon.ico b/build/icons/icon.ico index 39cc8e6..f546346 100644 Binary files a/build/icons/icon.ico and b/build/icons/icon.ico differ diff --git a/package-lock.json b/package-lock.json index cf80642..02a1780 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "ytdownloader", - "version": "0.0.1", + "name": "YT.Downloader", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4316,6 +4316,27 @@ "keyboardevents-areequal": "^0.2.1" } }, + "electron-notify": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/electron-notify/-/electron-notify-0.1.0.tgz", + "integrity": "sha1-jyS5QNssnzOv+RnVa/iv+cpDKLU=", + "requires": { + "async": "^0.9.0", + "lodash": "^2.4.1" + }, + "dependencies": { + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "lodash": { + "version": "2.4.2", + "resolved": "http://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + } + } + }, "electron-osx-sign": { "version": "0.4.10", "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz", diff --git a/package.json b/package.json index 3a0d176..3c7d013 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { - "name": "YT.Downloader", - "version": "1.0.0", + "name": "ytdownloader", + "version": "2.0.0-alpha", "author": "Mustafa Yazar ", "description": "Youtube Video Downloader&Converter and Play Music", "license": "MIT", "main": "./dist/electron/main.js", "scripts": { "build": "node .electron-vue/build.js && electron-builder", + "build:win": "node .electron-vue/build.js && electron-builder -w", "build:dir": "node .electron-vue/build.js && electron-builder --dir", "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", @@ -46,10 +47,12 @@ "icon": "build/icons/icon.icns" }, "win": { - "icon": "build/icons/icon.ico" + "icon": "build/icons/icon.ico", + "target":["nsis"] }, "linux": { - "icon": "build/icons" + "icon": "build/icons", + "target": ["deb", "AppImage"] } }, "dependencies": { @@ -57,6 +60,7 @@ "@fortawesome/free-solid-svg-icons": "^5.3.1", "@fortawesome/vue-fontawesome": "^0.1.1", "dataurl": "^0.1.0", + "electron-notify": "^0.1.0", "ffmpeg-binaries": "^4.0.0", "fluent-ffmpeg": "^2.1.2", "i": "^0.3.6", diff --git a/src/main/index.js b/src/main/index.js index 76eaef6..f71170c 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,4 +1,4 @@ -import { app, BrowserWindow } from 'electron' // eslint-disable-line +import { app, BrowserWindow, globalShortcut } from 'electron' // eslint-disable-line /** * Set `__static` path to static files in production @@ -28,6 +28,31 @@ function createWindow () { mainWindow.on('closed', () => { mainWindow = null }) + + + globalShortcut.register('VolumeUp', () => { + mainWindow.webContents.send('mp-volume-up'); + }) + + globalShortcut.register('VolumeDown', () => { + mainWindow.webContents.send('mp-volume-down'); + }) + + globalShortcut.register('VolumeMute', () => { + mainWindow.webContents.send('mp-volume-mute'); + }) + + globalShortcut.register('MediaNextTrack', () => { + mainWindow.webContents.send('mp-media-next'); + }) + + globalShortcut.register('MediaPreviousTrack', () => { + mainWindow.webContents.send('mp-media-prev'); + }) + + globalShortcut.register('MediaPlayPause', () => { + mainWindow.webContents.send('mp-play-pause'); + }) } app.on('ready', createWindow) diff --git a/src/renderer/components/MainPage.vue b/src/renderer/components/MainPage.vue index 1a13ddc..80cb2dd 100644 --- a/src/renderer/components/MainPage.vue +++ b/src/renderer/components/MainPage.vue @@ -81,6 +81,9 @@ import audioHelper from '../../main/libs/audioHelper.js'; openSettings(){ this.$electron.remote.getCurrentWindow().toggleDevTools(); }, + pasteData(){ + document.execCommand('paste'); + }, download(){ ytHelper.getInfo(this.url).then((info) => { @@ -102,6 +105,7 @@ import audioHelper from '../../main/libs/audioHelper.js'; let itemIndex=this.list.length - 1; ytHelper.download(this.url,output).then((res) =>{ + this.$eNotify.notify({ title: this.$eNotify.messages.getLocale('START_DOWNLOAD'), text: info.title }); this.list[itemIndex].progressShow=true; let totalSize = res.headers['content-length']; let dataRead = 0; @@ -113,7 +117,7 @@ import audioHelper from '../../main/libs/audioHelper.js'; }); res.on('end', function() { self.list[itemIndex].progressShow = false; - + self.$eNotify.notify({ title: self.$eNotify.messages.getLocale('START_CONVERT'), text: info.title }); self.list[itemIndex].progressShow=true; let proc = new ffmpeg({source:output}); @@ -129,6 +133,7 @@ import audioHelper from '../../main/libs/audioHelper.js'; self.list[itemIndex].progressPercent = progress.percent.toFixed(2); }) .on('end', () => { + self.$eNotify.notify({ title: self.$eNotify.messages.getLocale('COMPLETE_CONVERT'), text: info.title }); self.list[itemIndex].progressShow=false; fs.unlinkSync(output); }); @@ -148,7 +153,8 @@ import audioHelper from '../../main/libs/audioHelper.js';
YT.Downloader
- +
@@ -200,6 +206,10 @@ import audioHelper from '../../main/libs/audioHelper.js';
  • Remove From Disk
  • + +
  • Paste (CTRL + V)
  • +
    +
    @@ -208,7 +218,7 @@ import audioHelper from '../../main/libs/audioHelper.js';