Small changes

This commit is contained in:
aandrew-me 2022-07-31 12:28:14 +06:00
parent 69bb361fa7
commit 1dd426025f
10 changed files with 20 additions and 7 deletions

5
app.js
View File

@ -70,6 +70,7 @@ fs.readFile(configPath, (err) => {
}); });
} else { } else {
downloadDir = homedir + "/Videos/ytDownloader/"; 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]]) Promise.all([arr[0], arr[1]])
.then((response) => { .then((response) => {
cp.exec( cp.exec(
`"${ffmpeg}" -i '${tempDir + videoName}' -i '${ `"${ffmpeg}" -i "${tempDir + videoName}" -i "${
tempDir + audioName tempDir + audioName
}' -c copy '${downloadDir + filename}'`, }" -c copy "${downloadDir + filename}"`,
(error, stdout, stderr) => { (error, stdout, stderr) => {
if (error) { if (error) {
console.log(error); console.log(error);

View File

@ -150,7 +150,7 @@
}) })
socket.on("saved", (savedLocation) => { socket.on("saved", (savedLocation) => {
const notify = new Notification('ytDownloaded', { const notify = new Notification('ytDownloader', {
body: "File saved successfully.", body: "File saved successfully.",
icon: 'icon.png' icon: 'icon.png'
}); });

View File

@ -5,7 +5,8 @@ require("./app.js")
function createWindow () { function createWindow () {
const win = new BrowserWindow({ const win = new BrowserWindow({
show:false show:false,
icon:__dirname + "/public/icon.png"
}) })
win.loadURL("http://localhost:59876") win.loadURL("http://localhost:59876")
@ -15,12 +16,16 @@ function createWindow () {
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
autoUpdater.checkForUpdatesAndNotify()
app.on('activate', () => { app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) { if (BrowserWindow.getAllWindows().length === 0) {
createWindow() createWindow()
autoUpdater.checkForUpdatesAndNotify()
} }
}) })
if (process.platform === 'win32')
{
app.setAppUserModelId(app.name);
}
}) })
app.on('window-all-closed', () => { app.on('window-all-closed', () => {

View File

@ -9,7 +9,7 @@
"ytdl-core": "^4.11.0" "ytdl-core": "^4.11.0"
}, },
"name": "ytdownloader", "name": "ytdownloader",
"version": "1.5.4", "version": "1.5.5",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
@ -32,6 +32,13 @@
"build": { "build": {
"productName": "YTDownloader", "productName": "YTDownloader",
"appId": "org.andrew.ytdownloader", "appId": "org.andrew.ytdownloader",
"files": [
"./resources/**/*",
"*.js",
"./html/**/*",
"./resources/**/*",
"./public/**/*"
],
"mac": { "mac": {
"category": "Utility", "category": "Utility",
"target": [ "target": [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -100,7 +100,7 @@ function getInfo() {
const itag = format.itag; const itag = format.itag;
if (pattern.test(format.audioCodec)) { if (pattern.test(format.audioCodec)) {
audioCodec = "m4a"; audioCodec = "mp4a";
} else { } else {
audioCodec = format.audioCodec; audioCodec = format.audioCodec;
} }

Binary file not shown.

BIN
resources/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
resources/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB