diff --git a/com.neosubhamoy.neodlp.desktop b/com.neosubhamoy.neodlp.desktop index 537d543..2cce5b2 100644 --- a/com.neosubhamoy.neodlp.desktop +++ b/com.neosubhamoy.neodlp.desktop @@ -2,7 +2,7 @@ Type=Application Name=NeoDLP -Comment=Modern video/audio downloader based on yt-dlp with browser integration. +Comment=Modern feature-rich video/audio downloader based on yt-dlp. Icon=com.neosubhamoy.neodlp Exec=neodlp Terminal=false diff --git a/com.neosubhamoy.neodlp.metainfo.xml b/com.neosubhamoy.neodlp.metainfo.xml index 3b800e3..23bde01 100644 --- a/com.neosubhamoy.neodlp.metainfo.xml +++ b/com.neosubhamoy.neodlp.metainfo.xml @@ -2,7 +2,7 @@ com.neosubhamoy.neodlp NeoDLP - Modern video/audio downloader based on yt-dlp with browser integration + Modern feature-rich video/audio downloader based on yt-dlp Subhamoy Biswas @@ -15,7 +15,7 @@

NeoDLP is a cross-platform desktop application designed for downloading videos and audio from various online sources based on yt-dlp. - It offers modern user interface, lots of customization options and seamless browser integration. + It offers modern user interface, lots of features and customization options.

com.neosubhamoy.neodlp.desktop @@ -39,8 +39,8 @@ - - https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.2 + + https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.3
diff --git a/src-tauri/tauri.linux-flatpak.conf.json b/src-tauri/tauri.linux-flatpak.conf.json index d8bc6b1..f3056fe 100644 --- a/src-tauri/tauri.linux-flatpak.conf.json +++ b/src-tauri/tauri.linux-flatpak.conf.json @@ -1,8 +1,8 @@ { "identifier": "com.neosubhamoy.neodlp", "build": { - "beforeDevCommand": "cargo build --manifest-path=./src-tauri/msghost/Cargo.toml && npm run dev", - "beforeBuildCommand": "cargo build --release --manifest-path=./src-tauri/msghost/Cargo.toml && npm run build", + "beforeDevCommand": "npm run dev", + "beforeBuildCommand": "npm run build", "devUrl": "http://localhost:1420", "frontendDist": "../dist" }, @@ -38,8 +38,6 @@ ], "externalBin": [ "binaries/yt-dlp", - "binaries/ffmpeg", - "binaries/ffprobe", "binaries/aria2c", "binaries/deno", "binaries/neodlp-pot" diff --git a/src/components/pages/settings/applicationSettings.tsx b/src/components/pages/settings/applicationSettings.tsx index 8016386..d451f07 100644 --- a/src/components/pages/settings/applicationSettings.tsx +++ b/src/components/pages/settings/applicationSettings.tsx @@ -1403,6 +1403,8 @@ function AppPoTokenSettings() { function AppNotificationSettings() { const { saveSettingsKey } = useSettings(); + const isFlatpak = useEnvironmentStore(state => state.isFlatpak); + const enableNotifications = useSettingsPageStatesStore(state => state.settings.enable_notifications); const updateNotification = useSettingsPageStatesStore(state => state.settings.update_notification); const downloadCompletionNotification = useSettingsPageStatesStore(state => state.settings.download_completion_notification); @@ -1416,6 +1418,7 @@ function AppNotificationSettings() { { if (checked) { const granted = await isPermissionGranted(); @@ -1441,7 +1444,7 @@ function AppNotificationSettings() { id="update-notification" checked={updateNotification} onCheckedChange={(checked) => saveSettingsKey('update_notification', checked)} - disabled={!enableNotifications} + disabled={!enableNotifications || isFlatpak} /> @@ -1450,7 +1453,7 @@ function AppNotificationSettings() { id="download-completion-notification" checked={downloadCompletionNotification} onCheckedChange={(checked) => saveSettingsKey('download_completion_notification', checked)} - disabled={!enableNotifications} + disabled={!enableNotifications || isFlatpak} /> @@ -1813,7 +1816,7 @@ function AppInfoSettings() { Flatpak Sandbox Detected! - It looks like you are running NeoDLP in a Flatpak sandbox. Some features like changing download folder, revealing completed downloads in explorer and automatic yt-dlp updates are not available in Flatpak due to sandbox restrictions. To use these features, please install the native build (DEB, RPM or AUR) of NeoDLP. + It looks like you are running NeoDLP in a Flatpak sandbox. Some features like browser integration, desktop notifications, changing download folder, revealing completed downloads in explorer, automatic yt-dlp updates and auto-launch on startup are not available in Flatpak due to sandbox restrictions. To use these features, please install the native linux build (DEB, RPM or AUR) of NeoDLP. ) : isAppimage ? ( @@ -1821,7 +1824,7 @@ function AppInfoSettings() { Appimage Environment Detected! - Looks like you are using NeoDLP Appimage. NeoDLP's browser integration features are not available on Appimage environment due to it's limitations. To use NeoDLP's browser integration features please install the native build (DEB, RPM or AUR) of NeoDLP. + Looks like you are using NeoDLP Appimage. NeoDLP's browser integration features are not available on Appimage environment due to it's limitations. To use NeoDLP's browser integration features please install the native linux build (DEB, RPM or AUR) of NeoDLP. ) : ( diff --git a/src/helpers/use-linux-registerer.ts b/src/helpers/use-linux-registerer.ts index 2ffa3fe..b63be88 100644 --- a/src/helpers/use-linux-registerer.ts +++ b/src/helpers/use-linux-registerer.ts @@ -2,7 +2,7 @@ import { join, resourceDir, homeDir } from "@tauri-apps/api/path"; import * as fs from "@tauri-apps/plugin-fs"; import { useKvPairs } from "@/helpers/use-kvpairs"; import { useSettingsPageStatesStore } from "@/services/store"; -import { Command } from "@tauri-apps/plugin-shell"; +// import { Command } from "@tauri-apps/plugin-shell"; import { invoke } from "@tauri-apps/api/core"; interface FileMap { @@ -21,20 +21,20 @@ export function useLinuxRegisterer() { const isFlatpak = await invoke('is_flatpak'); const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir(); const homeDirPath = await homeDir(); - const flatpakChromeManifestContent = { - name: "com.neosubhamoy.neodlp", - description: "NeoDLP MsgHost", - path: `${homeDirPath}/.local/bin/neodlp-msghost`, - type: "stdio", - allowed_origins: ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"] - }; - const flatpakFirefoxManifestContent = { - name: "com.neosubhamoy.neodlp", - description: "NeoDLP MsgHost", - path: `${homeDirPath}/.local/bin/neodlp-msghost`, - type: "stdio", - allowed_extensions: ["neodlp@neosubhamoy.com"] - }; + // const flatpakChromeManifestContent = { + // name: "com.neosubhamoy.neodlp", + // description: "NeoDLP MsgHost", + // path: `${homeDirPath}/.local/bin/neodlp-msghost`, + // type: "stdio", + // allowed_origins: ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"] + // }; + // const flatpakFirefoxManifestContent = { + // name: "com.neosubhamoy.neodlp", + // description: "NeoDLP MsgHost", + // path: `${homeDirPath}/.local/bin/neodlp-msghost`, + // type: "stdio", + // allowed_extensions: ["neodlp@neosubhamoy.com"] + // }; const filesToCopy: FileMap[] = [ { source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil.py', destination: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil.py', dir: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' }, @@ -42,39 +42,42 @@ export function useLinuxRegisterer() { { source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', destination: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', dir: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' }, ]; - const filesToCopyFlatpak: FileMap[] = [ - { source: 'chrome.json', destination: '.config/google-chrome/NativeMessagingHosts/com.neosubhamoy.neodlp.json', dir: '.config/google-chrome/NativeMessagingHosts/', content: JSON.stringify(flatpakChromeManifestContent) }, - { source: 'chrome.json', destination: '.config/chromium/NativeMessagingHosts/com.neosubhamoy.neodlp.json', dir: '.config/chromium/NativeMessagingHosts/', content: JSON.stringify(flatpakChromeManifestContent) }, - { source: 'firefox.json', destination: '.mozilla/native-messaging-hosts/com.neosubhamoy.neodlp.json', dir: '.mozilla/native-messaging-hosts/', content: JSON.stringify(flatpakFirefoxManifestContent) }, - { source: 'neodlp-msghost', destination: '.local/bin/neodlp-msghost', dir: '.local/bin/' }, - ]; + // const filesToCopyFlatpak: FileMap[] = [ + // { source: 'chrome.json', destination: '.config/google-chrome/NativeMessagingHosts/com.neosubhamoy.neodlp.json', dir: '.config/google-chrome/NativeMessagingHosts/', content: JSON.stringify(flatpakChromeManifestContent) }, + // { source: 'chrome.json', destination: '.config/chromium/NativeMessagingHosts/com.neosubhamoy.neodlp.json', dir: '.config/chromium/NativeMessagingHosts/', content: JSON.stringify(flatpakChromeManifestContent) }, + // { source: 'firefox.json', destination: '.mozilla/native-messaging-hosts/com.neosubhamoy.neodlp.json', dir: '.mozilla/native-messaging-hosts/', content: JSON.stringify(flatpakFirefoxManifestContent) }, + // { source: 'neodlp-msghost', destination: '.local/bin/neodlp-msghost', dir: '.local/bin/' }, + // ]; if (isFlatpak) { - for (const file of filesToCopyFlatpak) { - const sourcePath = await join(resourceDirPath, file.source); - const destinationPath = await join(homeDirPath, file.destination); - const escapedContent = file.content?.replace(/'/g, `'\\''`) || ''; - const copyCommand = Command.create('sh', ['-c', `cp "${sourcePath}" "${destinationPath}"`]); - const writeCommand = Command.create('sh', ['-c', `printf '%s' '${escapedContent}' > "${destinationPath}"`]); + // Skip registration and just return success in flatpak + console.log('Running in Flatpak, Skipping registration...'); - if (file.content) { - const writeOutput = await writeCommand.execute(); - if (writeOutput.code === 0) { - console.log(`File ${file.destination} created successfully at ${destinationPath}`); - } else { - console.error(`Failed to create file ${file.destination} at ${destinationPath}:`, writeOutput.stderr); - return { success: false, message: 'Failed to register' }; - } - } else { - const copyOutput = await copyCommand.execute(); - if (copyOutput.code === 0) { - console.log(`File ${file.source} copied successfully to ${destinationPath}`); - } else { - console.error(`Failed to copy file ${file.source} to ${destinationPath}:`, copyOutput.stderr); - return { success: false, message: 'Failed to register' }; - } - } - } + // for (const file of filesToCopyFlatpak) { + // const sourcePath = await join(resourceDirPath, file.source); + // const destinationPath = await join(homeDirPath, file.destination); + // const escapedContent = file.content?.replace(/'/g, `'\\''`) || ''; + // const copyCommand = Command.create('sh', ['-c', `cp "${sourcePath}" "${destinationPath}"`]); + // const writeCommand = Command.create('sh', ['-c', `printf '%s' '${escapedContent}' > "${destinationPath}"`]); + + // if (file.content) { + // const writeOutput = await writeCommand.execute(); + // if (writeOutput.code === 0) { + // console.log(`File ${file.destination} created successfully at ${destinationPath}`); + // } else { + // console.error(`Failed to create file ${file.destination} at ${destinationPath}:`, writeOutput.stderr); + // return { success: false, message: 'Failed to register' }; + // } + // } else { + // const copyOutput = await copyCommand.execute(); + // if (copyOutput.code === 0) { + // console.log(`File ${file.source} copied successfully to ${destinationPath}`); + // } else { + // console.error(`Failed to copy file ${file.source} to ${destinationPath}:`, copyOutput.stderr); + // return { success: false, message: 'Failed to register' }; + // } + // } + // } } else { for (const file of filesToCopy) { const sourcePath = await join(resourceDirPath, file.source);