diff --git a/app.js b/app.js index 21df031..3c54bf2 100644 --- a/app.js +++ b/app.js @@ -70,6 +70,7 @@ fs.readFile(configPath, (err) => { }); } else { downloadDir = homedir + "/Videos/ytDownloader/"; + fs.mkdirSync(homedir + "/Videos/ytDownloader/", { recursive: true }); } }); @@ -304,9 +305,9 @@ app.post("/download", async (req, res) => { Promise.all([arr[0], arr[1]]) .then((response) => { cp.exec( - `"${ffmpeg}" -i '${tempDir + videoName}' -i '${ + `"${ffmpeg}" -i "${tempDir + videoName}" -i "${ tempDir + audioName - }' -c copy '${downloadDir + filename}'`, + }" -c copy "${downloadDir + filename}"`, (error, stdout, stderr) => { if (error) { console.log(error); diff --git a/html/index.html b/html/index.html index 4facaaa..41e9fc1 100644 --- a/html/index.html +++ b/html/index.html @@ -150,7 +150,7 @@ }) socket.on("saved", (savedLocation) => { - const notify = new Notification('ytDownloaded', { + const notify = new Notification('ytDownloader', { body: "File saved successfully.", icon: 'icon.png' }); diff --git a/main.js b/main.js index d71cdba..6283be2 100644 --- a/main.js +++ b/main.js @@ -5,7 +5,8 @@ require("./app.js") function createWindow () { const win = new BrowserWindow({ - show:false + show:false, + icon:__dirname + "/public/icon.png" }) win.loadURL("http://localhost:59876") @@ -15,12 +16,16 @@ function createWindow () { app.whenReady().then(() => { createWindow() - autoUpdater.checkForUpdatesAndNotify() app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) { createWindow() + autoUpdater.checkForUpdatesAndNotify() } }) + if (process.platform === 'win32') +{ + app.setAppUserModelId(app.name); +} }) app.on('window-all-closed', () => { diff --git a/package.json b/package.json index 69765ab..375acd5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "ytdl-core": "^4.11.0" }, "name": "ytdownloader", - "version": "1.5.4", + "version": "1.5.5", "main": "main.js", "scripts": { "start": "electron .", @@ -32,6 +32,13 @@ "build": { "productName": "YTDownloader", "appId": "org.andrew.ytdownloader", + "files": [ + "./resources/**/*", + "*.js", + "./html/**/*", + "./resources/**/*", + "./public/**/*" + ], "mac": { "category": "Utility", "target": [ diff --git a/public/icon.png b/public/icon.png index 12d0d92..1687f4f 100644 Binary files a/public/icon.png and b/public/icon.png differ diff --git a/public/index.js b/public/index.js index 69c178e..de4655d 100644 --- a/public/index.js +++ b/public/index.js @@ -100,7 +100,7 @@ function getInfo() { const itag = format.itag; if (pattern.test(format.audioCodec)) { - audioCodec = "m4a"; + audioCodec = "mp4a"; } else { audioCodec = format.audioCodec; } diff --git a/resources/icon.icns b/resources/icon.icns deleted file mode 100644 index 6b8e2b4..0000000 Binary files a/resources/icon.icns and /dev/null differ diff --git a/resources/icon.png b/resources/icon.png new file mode 100644 index 0000000..1687f4f Binary files /dev/null and b/resources/icon.png differ diff --git a/resources/256x256.png b/resources/icons/256x256.png similarity index 100% rename from resources/256x256.png rename to resources/icons/256x256.png diff --git a/resources/icons/64x64.png b/resources/icons/64x64.png new file mode 100644 index 0000000..23fef29 Binary files /dev/null and b/resources/icons/64x64.png differ