mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Merge pull request #4 from MasterAcnolo/Notification-System
Notification system + YT DLP Update
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,4 +2,5 @@
|
|||||||
/downloads
|
/downloads
|
||||||
/dist
|
/dist
|
||||||
logs/*.json
|
logs/*.json
|
||||||
|
logs/*.log
|
||||||
/out
|
/out
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
<!-- Release -->
|
<!-- Release -->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<!-- Build -->
|
<!-- Build (Next Release) -->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> This project aims to enable free, open-source, and unrestricted downloading of Video/Audio content. Eventually, it will allow users to choose
|
> This project aims to enable free, open-source, and unrestricted downloading of Video/Audio content. Eventually, it will allow users to choose
|
||||||
|
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
- ✅ Custom output path selection with saving
|
- ✅ Custom output path selection with saving
|
||||||
- ✅ Multiple graphical themes available for interface customization
|
- ✅ Multiple graphical themes available for interface customization
|
||||||
- ✅ Simple, intuitive, and responsive interface
|
- ✅ Simple, intuitive, and responsive interface
|
||||||
|
- ✅ Notification system when download finished (Click = Open Output Folder)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
<!-- Release -->
|
<!-- Release -->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<!-- Build -->
|
<!-- Build (Next Release) -->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> Ce projet a pour but de permettre le téléchargement de contenu Vidéo/Audio de manière gratuite, open source et libre. Il permettra à terme de choisir
|
> Ce projet a pour but de permettre le téléchargement de contenu Vidéo/Audio de manière gratuite, open source et libre. Il permettra à terme de choisir
|
||||||
|
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
- ✅ Choix du chemin de sortie personnalisé avec sauvegarde
|
- ✅ Choix du chemin de sortie personnalisé avec sauvegarde
|
||||||
- ✅ Plusieurs thèmes graphiques au choix pour personnaliser l’interface
|
- ✅ Plusieurs thèmes graphiques au choix pour personnaliser l’interface
|
||||||
- ✅ Interface simple, intuitive
|
- ✅ Interface simple, intuitive
|
||||||
|
- ✅ Notification quand le téléchargement est fini (Click = Ouverture Dossier Output)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
BIN
build/confirm-icon.png
Normal file
BIN
build/confirm-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.8 KiB |
10
package-lock.json
generated
10
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
"version": "1.0.2",
|
"version": "1.1.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
"version": "1.0.2",
|
"version": "1.1.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"debug": "^4.4.1",
|
"debug": "^4.4.1",
|
||||||
@@ -2792,9 +2792,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "37.1.0",
|
"version": "37.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-37.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-37.2.0.tgz",
|
||||||
"integrity": "sha512-Fcr3yfAw4oU392waVZSlrFUQx4P+h/k31+PRgkBY9tFx9E/zxzdPQQj0achZlG1HRDusw3ooQB+OXb9PvufdzA==",
|
"integrity": "sha512-dE6+qeg6SBUVd5d8CD2+GH82kh+gF1v40+hs+U+UOno681NMSGmBtgqwldQRpbvtnQDD7V2M9Cpfr3+Abw7aBg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
"productName": "Freedom Loader",
|
"productName": "Freedom Loader",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"author": "MasterAcnolo",
|
"author": "MasterAcnolo",
|
||||||
"description": "Freedom Loader, parce que nous le valons bien",
|
"description": "Freedom Loader, parce que nous le valons bien",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
@@ -43,6 +43,12 @@
|
|||||||
"buildResources": "build"
|
"buildResources": "build"
|
||||||
},
|
},
|
||||||
"asar": false,
|
"asar": false,
|
||||||
|
"extraResources": [
|
||||||
|
{
|
||||||
|
"from": "build/confirm-icon.png",
|
||||||
|
"to": "confirm-icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
"win": {
|
"win": {
|
||||||
"target": "nsis",
|
"target": "nsis",
|
||||||
"icon": "build/installer-icon.ico"
|
"icon": "build/installer-icon.ico"
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ const router = express.Router();
|
|||||||
const { execFile } = require("child_process");
|
const { execFile } = require("child_process");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const { Notification } = require("electron");
|
||||||
const logger = require("../logger").logger;
|
const logger = require("../logger").logger;
|
||||||
|
|
||||||
// Path vers le fichier exécutable yt-dlp (outil tiers pour le téléchargement)
|
// Path vers le fichier exécutable yt-dlp (outil tiers pour le téléchargement)
|
||||||
const ytDlpPath = path.join(__dirname, '../../yt-dlp.exe');
|
// const ytDlpPath = path.join(__dirname, '../../yt-dlp.exe');
|
||||||
|
const ytDlpPath = path.join(__dirname, '../../yt-dlp 2025.06.30.exe');
|
||||||
|
|
||||||
router.post("/", (req, res) => {
|
router.post("/", (req, res) => {
|
||||||
try {
|
try {
|
||||||
@@ -144,6 +145,25 @@ router.post("/", (req, res) => {
|
|||||||
child.on("close", (code) => {
|
child.on("close", (code) => {
|
||||||
logger.info(`yt-dlp terminé avec code de sortie : ${code}`);
|
logger.info(`yt-dlp terminé avec code de sortie : ${code}`);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
|
|
||||||
|
const iconPath = path.join(process.resourcesPath, "confirm-icon.png"); // la sécurité pour toutes les machines
|
||||||
|
|
||||||
|
console.log("Icon path pour la notif :", iconPath);
|
||||||
|
|
||||||
|
const notif = new Notification({
|
||||||
|
title: "Freedom Loader",
|
||||||
|
body: "Ton téléchargement est terminé, clique ici pour l'ouvrir.",
|
||||||
|
icon: iconPath,
|
||||||
|
});
|
||||||
|
|
||||||
|
notif.on("click", () => {
|
||||||
|
console.log("Notification cliquée !");
|
||||||
|
//Pour pouvoir ouvrir le dossier de la vidéo
|
||||||
|
const { shell } = require("electron");
|
||||||
|
shell.openPath(requestedOutputFolder);
|
||||||
|
});
|
||||||
|
|
||||||
|
notif.show();
|
||||||
res.send("✅ Téléchargement terminé !");
|
res.send("✅ Téléchargement terminé !");
|
||||||
} else {
|
} else {
|
||||||
res.status(500).send(`❌ yt-dlp a échoué avec le code : ${code}`);
|
res.status(500).send(`❌ yt-dlp a échoué avec le code : ${code}`);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const fs = require("fs");
|
|||||||
const { logger } = require("../logger"); // On récupère ton logger Winston
|
const { logger } = require("../logger"); // On récupère ton logger Winston
|
||||||
|
|
||||||
// Path absolu vers l'exécutable yt-dlp
|
// Path absolu vers l'exécutable yt-dlp
|
||||||
const ytDlpPath = path.join(__dirname, "../../yt-dlp.exe");
|
const ytDlpPath = path.join(__dirname, '../../yt-dlp 2025.06.30.exe');
|
||||||
|
|
||||||
// Vérification que yt-dlp.exe existe bien au lancement du module
|
// Vérification que yt-dlp.exe existe bien au lancement du module
|
||||||
if (!fs.existsSync(ytDlpPath)) {
|
if (!fs.existsSync(ytDlpPath)) {
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user