mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-27 20:11:15 +02:00
Compare commits
13 Commits
e541eb442a
...
1.6.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd43ae10fc | ||
|
|
6978277b4b | ||
|
|
b91c20d450 | ||
|
|
014b1ad52a | ||
|
|
ec93d20a39 | ||
|
|
09c511fcb8 | ||
|
|
f343fbd148 | ||
|
|
6d99d5f91c | ||
|
|
0f0bb874bf | ||
|
|
b9267ec408 | ||
|
|
311bff6df5 | ||
|
|
e4243a01ae | ||
|
|
52be9c6b4f |
46
.github/workflows/codeql.yml
vendored
Normal file
46
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: "CodeQL PR"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '00 00 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze (${{ matrix.language }})
|
||||||
|
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
packages: read
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- language: javascript-typescript
|
||||||
|
build-mode: none
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v4
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
build-mode: ${{ matrix.build-mode }}
|
||||||
|
|
||||||
|
- name: Run manual build steps
|
||||||
|
if: matrix.build-mode == 'manual'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo 'Manual build required'
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v4
|
||||||
|
with:
|
||||||
|
category: "/language:${{matrix.language}}"
|
||||||
@@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Freedom Loader is a desktop application built with Electron that provides a straightforward way to download video and audio content with full metadata support. The application focuses on reliability, transparency, and user privacy-no ads, no tracking, no questionable third-party services.
|
Freedom Loader is a desktop application built with Electron that provides a straightforward way to download video and audio content with full metadata support. The application focuses on reliability, transparency, and user privacy-no ads, no tracking, no questionable third-party services.
|
||||||
|
|||||||
@@ -123,14 +123,6 @@ async function stopRPC() {
|
|||||||
try {
|
try {
|
||||||
if (intervalId) clearInterval(intervalId);
|
if (intervalId) clearInterval(intervalId);
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensures RPC connection AND the underlying socket exist
|
|
||||||
* before attempting to clear activity to prevent crash.
|
|
||||||
*/
|
|
||||||
if (rpc.transport && rpc.transport.socket) {
|
|
||||||
await rpc.clearActivity();
|
|
||||||
}
|
|
||||||
|
|
||||||
await rpc.destroy();
|
await rpc.destroy();
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
const { ipcMain, dialog, shell } = require("electron");
|
const { ipcMain, dialog, shell } = require("electron");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const { logger, logDir } = require("../server/logger");
|
const { logger, logDir } = require("../server/logger");
|
||||||
const { configFeatures, featuresPath } = require("../config");
|
const {configFeatures, featuresPath, devMode} = require("../config");
|
||||||
const { getThemes, reloadThemes } = require("./themeManager");
|
const { getThemes, reloadThemes } = require("./themeManager");
|
||||||
const config = require("../config");
|
const config = require("../config");
|
||||||
const { validateDownloadPath, getDefaultDownloadPath } = require("./pathValidator");
|
const { validateDownloadPath, getDefaultDownloadPath } = require("./pathValidator");
|
||||||
@@ -114,7 +114,18 @@ function registerIpcHandlers(getMainWindow) {
|
|||||||
/**
|
/**
|
||||||
* Window minimize request from renderer.
|
* Window minimize request from renderer.
|
||||||
*/
|
*/
|
||||||
ipcMain.on("window-minimize", () => getMainWindow()?.minimize());
|
ipcMain.on("window-minimize", () => {
|
||||||
|
// Minimize to tray
|
||||||
|
if (configFeatures.systemTray) {
|
||||||
|
getMainWindow()?.hide()
|
||||||
|
logger.info("Window Minimized in SystemTray (Using Minimize Button)");
|
||||||
|
} else {
|
||||||
|
// Native minimize
|
||||||
|
getMainWindow()?.minimize()
|
||||||
|
logger.info("Window minimized normally");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles maximize/unmaximize state of main window.
|
* Toggles maximize/unmaximize state of main window.
|
||||||
@@ -223,7 +234,7 @@ function registerIpcHandlers(getMainWindow) {
|
|||||||
if (key === "systemTray") {
|
if (key === "systemTray") {
|
||||||
if (value === true) {
|
if (value === true) {
|
||||||
logger.info("System Tray enabled dynamically.");
|
logger.info("System Tray enabled dynamically.");
|
||||||
createSystemTray(getMainWindow(), config.devMode);
|
createSystemTray(devMode);
|
||||||
} else {
|
} else {
|
||||||
logger.info("System Tray disabled dynamically.");
|
logger.info("System Tray disabled dynamically.");
|
||||||
destroyTray();
|
destroyTray();
|
||||||
|
|||||||
23
app/tray.js
23
app/tray.js
@@ -2,6 +2,7 @@ const {app, Menu, Tray, nativeImage} = require("electron");
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const {logger} = require("../server/logger"); // Ajuste le chemin si besoin
|
const {logger} = require("../server/logger"); // Ajuste le chemin si besoin
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const {getMainWindow} = require("./windowManager");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global reference to the Tray instance to prevent garbage collection.
|
* Global reference to the Tray instance to prevent garbage collection.
|
||||||
@@ -17,11 +18,10 @@ let tray = null;
|
|||||||
* - Builds the right-click context menu.
|
* - Builds the right-click context menu.
|
||||||
* - Handles left-click behavior to toggle main window visibility.
|
* - Handles left-click behavior to toggle main window visibility.
|
||||||
*
|
*
|
||||||
* @param {import('electron').BrowserWindow} mainWindow - The main application window.
|
|
||||||
* @param {boolean} devMode - Indicates whether the application is running in development mode.
|
* @param {boolean} devMode - Indicates whether the application is running in development mode.
|
||||||
* @returns {Tray} The created Tray instance.
|
* @returns {Tray} The created Tray instance.
|
||||||
*/
|
*/
|
||||||
function createSystemTray(mainWindow, devMode) {
|
function createSystemTray(devMode) {
|
||||||
// Prevent creating multiple tray instances
|
// Prevent creating multiple tray instances
|
||||||
if (tray) return tray;
|
if (tray) return tray;
|
||||||
|
|
||||||
@@ -58,7 +58,12 @@ function createSystemTray(mainWindow, devMode) {
|
|||||||
{
|
{
|
||||||
label: "Show Freedom Loader",
|
label: "Show Freedom Loader",
|
||||||
click: () => {
|
click: () => {
|
||||||
mainWindow.show();
|
const window = getMainWindow();
|
||||||
|
if (window && !window.isDestroyed()) {
|
||||||
|
window.show();
|
||||||
|
window.focus();
|
||||||
|
logger.info("Window Restored from SystemTray (Using Show Action)");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
@@ -82,11 +87,15 @@ function createSystemTray(mainWindow, devMode) {
|
|||||||
* but it remains standard practice for Windows and Linux environments.
|
* but it remains standard practice for Windows and Linux environments.
|
||||||
*/
|
*/
|
||||||
tray.on("click", () => {
|
tray.on("click", () => {
|
||||||
if (mainWindow.isVisible()) {
|
const window = getMainWindow();
|
||||||
mainWindow.hide();
|
if (!window || window.isDestroyed()) return;
|
||||||
|
|
||||||
|
if (window.isVisible()) {
|
||||||
|
window.hide();
|
||||||
} else {
|
} else {
|
||||||
mainWindow.show();
|
window.show();
|
||||||
mainWindow.focus();
|
window.focus();
|
||||||
|
logger.info("Window Restored from SystemTray (Double Click on Tray Icon)")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -87,9 +87,11 @@ async function createMainWindow() {
|
|||||||
* cancels the destruction and hides the window instead.
|
* cancels the destruction and hides the window instead.
|
||||||
*/
|
*/
|
||||||
mainWindow.on('close', (event) => {
|
mainWindow.on('close', (event) => {
|
||||||
if (!app.isQuitting && config.systemTray ) {
|
|
||||||
|
if (!app.isQuitting && config.configFeatures.systemTray) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
mainWindow.hide();
|
mainWindow.hide();
|
||||||
|
logger.info("Window Minimized in SystemTray (Using Close Button)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const path = require("path");
|
|||||||
* Indicates whether the application is running in development mode.
|
* Indicates whether the application is running in development mode.
|
||||||
* Determined by Electron's packaging state.
|
* Determined by Electron's packaging state.
|
||||||
*/
|
*/
|
||||||
const devMode = process.env.NODE_ENV === "test" || !app?.isPackaged;
|
const devMode = !app.isPackaged || process.env.NODE_ENV === "test";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves the configuration file path depending on runtime environment.
|
* Resolves the configuration file path depending on runtime environment.
|
||||||
|
|||||||
8
main.js
8
main.js
@@ -38,7 +38,7 @@ app.setAppUserModelId("com.masteracnolo.freedomloader");
|
|||||||
* Load the app dependencies for hardware choice
|
* Load the app dependencies for hardware choice
|
||||||
*/
|
*/
|
||||||
const { logger, logSessionStart, logSessionEnd, logDir } = require("./server/logger");
|
const { logger, logSessionStart, logSessionEnd, logDir } = require("./server/logger");
|
||||||
const { configFeatures } = require("./config");
|
const { configFeatures, devMode} = require("./config");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In-memory snapshot of application feature flags.
|
* In-memory snapshot of application feature flags.
|
||||||
@@ -53,7 +53,7 @@ if (!configFeatures.enableHardwareAcceleration){
|
|||||||
logger.info("Enable Hardware Acceleration")
|
logger.info("Enable Hardware Acceleration")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(configFeatures.devMode){
|
if(devMode){
|
||||||
/**
|
/**
|
||||||
* Start devTron extensions - @see https://github.com/electron/devtron
|
* Start devTron extensions - @see https://github.com/electron/devtron
|
||||||
*/
|
*/
|
||||||
@@ -135,7 +135,7 @@ app.whenReady().then(async () => {
|
|||||||
|
|
||||||
createSplashWindow();
|
createSplashWindow();
|
||||||
|
|
||||||
if (!configFeatures.devMode && !checkNativeDependencies()) return;
|
if (!devMode && !checkNativeDependencies()) return;
|
||||||
|
|
||||||
const { userYtDlp } = require("./server/helpers/path.helpers");
|
const { userYtDlp } = require("./server/helpers/path.helpers");
|
||||||
updateYtDlp(userYtDlp);
|
updateYtDlp(userYtDlp);
|
||||||
@@ -161,7 +161,7 @@ app.whenReady().then(async () => {
|
|||||||
getMainWindow().show();
|
getMainWindow().show();
|
||||||
|
|
||||||
if (configFeatures.systemTray) {
|
if (configFeatures.systemTray) {
|
||||||
createSystemTray(getMainWindow(), configFeatures.devMode);
|
createSystemTray(devMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configFeatures.discordRPC) startRPC();
|
if (configFeatures.discordRPC) startRPC();
|
||||||
|
|||||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
"version": "1.6.2-preview",
|
"version": "1.6.3-preview",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
"version": "1.6.2-preview",
|
"version": "1.6.3-preview",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
"@electron/devtron": "^2.1.1",
|
"@electron/devtron": "^2.1.1",
|
||||||
"@jest/globals": "^30.4.1",
|
"@jest/globals": "^30.4.1",
|
||||||
"@playwright/test": "^1.62.1",
|
"@playwright/test": "^1.62.1",
|
||||||
"electron": "^43.3.0",
|
"electron": "^44.3.0",
|
||||||
"electron-builder": "^26.15.3",
|
"electron-builder": "^26.15.3",
|
||||||
"jest": "^30.4.2",
|
"jest": "^30.4.2",
|
||||||
"nodemon": "^3.1.14",
|
"nodemon": "^3.1.14",
|
||||||
@@ -3910,9 +3910,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "43.3.0",
|
"version": "44.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-43.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-44.3.0.tgz",
|
||||||
"integrity": "sha512-nLlvu0WFjftWsSaTkV2B/c4NDuJBspTyXu8vKSQ6vLvFt8uG3NgN49LLKcXddwX0GqVvAQDhciWp+4xOdTdhew==",
|
"integrity": "sha512-St9EV7F2VtYaYWD2qaAjBwUgKxx39eJOUsUJ5+/1113sqbVfNqv4Dbm/W1rN7qmYSPa+mWwR6yr+b7MfgjgVfQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
|
"desktopName": "com.masteracnolo.freedomloader",
|
||||||
"productName": "Freedom Loader",
|
"productName": "Freedom Loader",
|
||||||
"version": "1.6.3-preview",
|
"version": "1.6.3",
|
||||||
"author": "MasterAcnolo <MasterAcnolo@users.noreply.github.com>",
|
"author": "MasterAcnolo <MasterAcnolo@users.noreply.github.com>",
|
||||||
"description": "Free and open-source GUI for yt-dlp — download video and audio from hundreds of platforms",
|
"description": "Free and open-source GUI for yt-dlp — download video and audio from hundreds of platforms",
|
||||||
"homepage": "https://masteracnolo.github.io/Freedom-Loader-Site/",
|
"homepage": "https://masteracnolo.github.io/Freedom-Loader-Site/",
|
||||||
@@ -21,7 +22,6 @@
|
|||||||
"dev": "nodemon --watch server --watch app --watch main.js --watch config.js --ext js,json --exec \"electron --no-warnings .\"",
|
"dev": "nodemon --watch server --watch app --watch main.js --watch config.js --ext js,json --exec \"electron --no-warnings .\"",
|
||||||
"dev:warn": "nodemon --watch server --watch app --watch main.js --watch config.js --ext js,json --exec \"electron --trace-warnings .\"",
|
"dev:warn": "nodemon --watch server --watch app --watch main.js --watch config.js --ext js,json --exec \"electron --trace-warnings .\"",
|
||||||
"dev:debug": "nodemon --watch server --watch app --watch main.js --watch config.js --ext js,json --exec \"WAYLAND_DEBUG=1 ELECTRON_ENABLE_LOGGING=1 ELECTRON_ENABLE_STACK_DUMPING=1 electron --enable-logging --v=1 .\"",
|
"dev:debug": "nodemon --watch server --watch app --watch main.js --watch config.js --ext js,json --exec \"WAYLAND_DEBUG=1 ELECTRON_ENABLE_LOGGING=1 ELECTRON_ENABLE_STACK_DUMPING=1 electron --enable-logging --v=1 .\"",
|
||||||
|
|
||||||
"build": "electron-builder",
|
"build": "electron-builder",
|
||||||
"build:win": "electron-builder --win",
|
"build:win": "electron-builder --win",
|
||||||
"build:linux": "electron-builder --linux",
|
"build:linux": "electron-builder --linux",
|
||||||
@@ -30,10 +30,8 @@
|
|||||||
"release": "bash scripts/release.sh",
|
"release": "bash scripts/release.sh",
|
||||||
"release:publish": "bash scripts/release.sh --publish",
|
"release:publish": "bash scripts/release.sh --publish",
|
||||||
"release:dry-run": "bash scripts/release.sh --dry-run",
|
"release:dry-run": "bash scripts/release.sh --dry-run",
|
||||||
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:unit": "jest test/unit",
|
"test:unit": "jest test/unit",
|
||||||
|
|
||||||
"update": "npm update"
|
"update": "npm update"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -52,7 +50,7 @@
|
|||||||
"@electron/devtron": "^2.1.1",
|
"@electron/devtron": "^2.1.1",
|
||||||
"@jest/globals": "^30.4.1",
|
"@jest/globals": "^30.4.1",
|
||||||
"@playwright/test": "^1.62.1",
|
"@playwright/test": "^1.62.1",
|
||||||
"electron": "^43.3.0",
|
"electron": "^44.3.0",
|
||||||
"electron-builder": "^26.15.3",
|
"electron-builder": "^26.15.3",
|
||||||
"jest": "^30.4.2",
|
"jest": "^30.4.2",
|
||||||
"nodemon": "^3.1.14",
|
"nodemon": "^3.1.14",
|
||||||
@@ -136,6 +134,8 @@
|
|||||||
"snap"
|
"snap"
|
||||||
],
|
],
|
||||||
"category": "Utility",
|
"category": "Utility",
|
||||||
|
"synopsis": "GUI for yt-dlp to download video and audio with metadata",
|
||||||
|
"maintainer": "MasterAcnolo",
|
||||||
"icon": "build/app-icon.png",
|
"icon": "build/app-icon.png",
|
||||||
"executableName": "freedom-loader",
|
"executableName": "freedom-loader",
|
||||||
"extraResources": [
|
"extraResources": [
|
||||||
|
|||||||
@@ -108,16 +108,6 @@ RELEASE_NOTES="# Freedom Loader - $VERSION
|
|||||||
## Found a bug or issue?
|
## Found a bug or issue?
|
||||||
Please report it in the [GitHub Issues](https://github.com/MasterAcnolo/Freedom-Loader/issues) section.
|
Please report it in the [GitHub Issues](https://github.com/MasterAcnolo/Freedom-Loader/issues) section.
|
||||||
|
|
||||||
## Next Release (non-exhaustive roadmap)
|
|
||||||
- More format options
|
|
||||||
- Subtitle support
|
|
||||||
- Improved UI / UX
|
|
||||||
- Language selection
|
|
||||||
- Download specific parts of videos
|
|
||||||
- File renaming options
|
|
||||||
- Parallel downloads
|
|
||||||
- Skip sponsored parts automatically
|
|
||||||
|
|
||||||
**Full Changelog**: https://github.com/MasterAcnolo/Freedom-Loader/compare/${PREV_TAG}...${TAG}"
|
**Full Changelog**: https://github.com/MasterAcnolo/Freedom-Loader/compare/${PREV_TAG}...${TAG}"
|
||||||
|
|
||||||
if [ "$DRY_RUN" = false ]; then
|
if [ "$DRY_RUN" = false ]; then
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ function validateBinaries() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to lazy load logger, avoid circular import
|
* Helper to lazy load logger, avoid circular import
|
||||||
* @returns {winston.Logger}
|
* @returns {import("winston").Logger}
|
||||||
*/
|
*/
|
||||||
function getLogger() {
|
function getLogger() {
|
||||||
return require("../logger.js").logger;
|
return require("../logger.js").logger;
|
||||||
|
|||||||
Reference in New Issue
Block a user