1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 22:55:48 +05:30

4 Commits

5 changed files with 52 additions and 43 deletions

View File

@@ -39,7 +39,7 @@
</screenshots> </screenshots>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<releases> <releases>
<release version="0.4.3" date="2026-03-06"> <release version="0.4.3" date="2026-03-07">
<url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.3</url> <url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.3</url>
</release> </release>
</releases> </releases>

View File

@@ -319,7 +319,7 @@ const binaries = {
{ {
name: 'deno-aarch64-apple-darwin', name: 'deno-aarch64-apple-darwin',
platform: 'darwin', platform: 'darwin',
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-aarch64-apple-darwin.zip`, url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/v'+versions['deno'] : ''}/deno-aarch64-apple-darwin.zip`,
src: path.join(downloadDir, 'deno-aarch64-apple-darwin.zip'), src: path.join(downloadDir, 'deno-aarch64-apple-darwin.zip'),
dest: null, dest: null,
archive: { archive: {

View File

@@ -785,6 +785,8 @@ function AppNetworkSettings() {
function AppCookiesSettings() { function AppCookiesSettings() {
const { saveSettingsKey } = useSettings(); const { saveSettingsKey } = useSettings();
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
const useCookies = useSettingsPageStatesStore(state => state.settings.use_cookies); const useCookies = useSettingsPageStatesStore(state => state.settings.use_cookies);
const importCookiesFrom = useSettingsPageStatesStore(state => state.settings.import_cookies_from); const importCookiesFrom = useSettingsPageStatesStore(state => state.settings.import_cookies_from);
const cookiesBrowser = useSettingsPageStatesStore(state => state.settings.cookies_browser); const cookiesBrowser = useSettingsPageStatesStore(state => state.settings.cookies_browser);
@@ -801,7 +803,7 @@ function AppCookiesSettings() {
id="use-cookies" id="use-cookies"
checked={useCookies} checked={useCookies}
onCheckedChange={(checked) => saveSettingsKey('use_cookies', checked)} onCheckedChange={(checked) => saveSettingsKey('use_cookies', checked)}
disabled={useCustomCommands} disabled={useCustomCommands || isFlatpak}
/> />
<Label htmlFor="use-cookies">Use Cookies</Label> <Label htmlFor="use-cookies">Use Cookies</Label>
</div> </div>
@@ -810,7 +812,7 @@ function AppCookiesSettings() {
className="flex items-center gap-4" className="flex items-center gap-4"
value={importCookiesFrom} value={importCookiesFrom}
onValueChange={(value) => saveSettingsKey('import_cookies_from', value)} onValueChange={(value) => saveSettingsKey('import_cookies_from', value)}
disabled={!useCookies || useCustomCommands} disabled={!useCookies || useCustomCommands || isFlatpak}
> >
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<RadioGroupItem value="browser" id="cookies-browser" /> <RadioGroupItem value="browser" id="cookies-browser" />
@@ -826,7 +828,7 @@ function AppCookiesSettings() {
<Select <Select
value={cookiesBrowser} value={cookiesBrowser}
onValueChange={(value) => saveSettingsKey('cookies_browser', value)} onValueChange={(value) => saveSettingsKey('cookies_browser', value)}
disabled={importCookiesFrom !== "browser" || !useCookies || useCustomCommands} disabled={importCookiesFrom !== "browser" || !useCookies || useCustomCommands || isFlatpak}
> >
<SelectTrigger className="w-57.5 ring-0 focus:ring-0"> <SelectTrigger className="w-57.5 ring-0 focus:ring-0">
<SelectValue placeholder="Select browser to import cookies" /> <SelectValue placeholder="Select browser to import cookies" />
@@ -853,7 +855,7 @@ function AppCookiesSettings() {
<Input className="focus-visible:ring-0" type="text" placeholder="Select cookies text file" value={cookiesFile ?? ''} disabled={importCookiesFrom !== "file" || !useCookies} readOnly/> <Input className="focus-visible:ring-0" type="text" placeholder="Select cookies text file" value={cookiesFile ?? ''} disabled={importCookiesFrom !== "file" || !useCookies} readOnly/>
<Button <Button
variant="outline" variant="outline"
disabled={importCookiesFrom !== "file" || !useCookies || useCustomCommands} disabled={importCookiesFrom !== "file" || !useCookies || useCustomCommands || isFlatpak}
onClick={async () => { onClick={async () => {
try { try {
const file = await open({ const file = await open({
@@ -1252,6 +1254,8 @@ function AppDelaySettings() {
} }
function AppPoTokenSettings() { function AppPoTokenSettings() {
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
const formResetTrigger = useSettingsPageStatesStore(state => state.formResetTrigger); const formResetTrigger = useSettingsPageStatesStore(state => state.formResetTrigger);
const acknowledgeFormReset = useSettingsPageStatesStore(state => state.acknowledgeFormReset); const acknowledgeFormReset = useSettingsPageStatesStore(state => state.acknowledgeFormReset);
@@ -1323,7 +1327,7 @@ function AppPoTokenSettings() {
await stopPotServer(); await stopPotServer();
} }
}} }}
disabled={useCustomCommands || isStartingPotServer || isChangingPotServerPort} disabled={useCustomCommands || isStartingPotServer || isChangingPotServerPort || isFlatpak}
/> />
<Label htmlFor="use-potoken">Use PO Token</Label> <Label htmlFor="use-potoken">Use PO Token</Label>
</div> </div>
@@ -1349,7 +1353,7 @@ function AppPoTokenSettings() {
id="disable-innertube" id="disable-innertube"
checked={disableInnertube} checked={disableInnertube}
onCheckedChange={(checked) => saveSettingsKey('disable_innertube', checked)} onCheckedChange={(checked) => saveSettingsKey('disable_innertube', checked)}
disabled={useCustomCommands || !usePotoken} disabled={useCustomCommands || !usePotoken || isFlatpak}
/> />
</div> </div>
</div> </div>
@@ -1362,7 +1366,7 @@ function AppPoTokenSettings() {
<FormField <FormField
control={potServerPortForm.control} control={potServerPortForm.control}
name="port" name="port"
disabled={!usePotoken || useCustomCommands || isChangingPotServerPort || isStartingPotServer} disabled={!usePotoken || isChangingPotServerPort || isStartingPotServer || isFlatpak}
render={({ field }) => ( render={({ field }) => (
<FormItem className="w-full"> <FormItem className="w-full">
<FormControl> <FormControl>
@@ -1381,7 +1385,7 @@ function AppPoTokenSettings() {
/> />
<Button <Button
type="submit" type="submit"
disabled={!watchedPotServerPort || Number(watchedPotServerPort) === potServerPort || Object.keys(potServerPortFormErrors).length > 0 || !usePotoken || useCustomCommands || isChangingPotServerPort || isStartingPotServer} disabled={!watchedPotServerPort || Number(watchedPotServerPort) === potServerPort || Object.keys(potServerPortFormErrors).length > 0 || !usePotoken || useCustomCommands || isChangingPotServerPort || isStartingPotServer || isFlatpak}
> >
{isChangingPotServerPort ? ( {isChangingPotServerPort ? (
<> <>
@@ -1816,7 +1820,7 @@ function AppInfoSettings() {
<TriangleAlert className="size-4 stroke-primary" /> <TriangleAlert className="size-4 stroke-primary" />
<AlertTitle className="text-sm">Flatpak Sandbox Detected!</AlertTitle> <AlertTitle className="text-sm">Flatpak Sandbox Detected!</AlertTitle>
<AlertDescription className="text-xs"> <AlertDescription className="text-xs">
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. It looks like you are running NeoDLP in a Flatpak sandbox. Some features like browser integration, desktop notifications, cookies, po tokens, 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.
</AlertDescription> </AlertDescription>
</Alert> </Alert>
) : isAppimage ? ( ) : isAppimage ? (

View File

@@ -2,7 +2,7 @@ import { join, resourceDir, homeDir } from "@tauri-apps/api/path";
import * as fs from "@tauri-apps/plugin-fs"; import * as fs from "@tauri-apps/plugin-fs";
import { useKvPairs } from "@/helpers/use-kvpairs"; import { useKvPairs } from "@/helpers/use-kvpairs";
import { useSettingsPageStatesStore } from "@/services/store"; 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"; import { invoke } from "@tauri-apps/api/core";
interface FileMap { interface FileMap {
@@ -42,43 +42,47 @@ 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/' }, { 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[] = [ // 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/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: '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: '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/' }, // { source: 'neodlp-msghost', destination: '.local/bin/neodlp-msghost', dir: '.local/bin/' },
{ source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil.py', destination: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil.py', dir: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' },
{ source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_cli.py', destination: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_cli.py', dir: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' }, // { source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil.py', destination: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil.py', dir: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' },
{ source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', destination: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', dir: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' }, // { source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_cli.py', destination: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_cli.py', dir: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' },
]; // { source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', destination: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', dir: '.var/app/com.neosubhamoy.neodlp/config/yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' },
// ];
if (isFlatpak) { if (isFlatpak) {
for (const file of filesToCopyFlatpak) { // Skip linux registration for Flatpak
const sourcePath = await join(resourceDirPath, file.source); console.log('Flatpak sandbox detected! Skipping Linux registration...');
const destinationDir = await join(homeDirPath, file.dir);
const destinationPath = await join(homeDirPath, file.destination);
const escapedContent = file.content?.replace(/'/g, `'\\''`) || '';
const copyCommand = Command.create('sh', ['-c', `mkdir -p "${destinationDir}" && cp "${sourcePath}" "${destinationPath}"`]);
const writeCommand = Command.create('sh', ['-c', `printf '%s' '${escapedContent}' > "${destinationPath}"`]);
if (file.content) { // for (const file of filesToCopyFlatpak) {
const writeOutput = await writeCommand.execute(); // const sourcePath = await join(resourceDirPath, file.source);
if (writeOutput.code === 0) { // const destinationDir = await join(homeDirPath, file.dir);
console.log(`File ${file.destination} created successfully at ${destinationPath}`); // const destinationPath = await join(homeDirPath, file.destination);
} else { // const escapedContent = file.content?.replace(/'/g, `'\\''`) || '';
console.error(`Failed to create file ${file.destination} at ${destinationPath}:`, writeOutput.stderr); // const copyCommand = Command.create('sh', ['-c', `mkdir -p "${destinationDir}" && cp "${sourcePath}" "${destinationPath}"`]);
return { success: false, message: 'Failed to register' }; // const writeCommand = Command.create('sh', ['-c', `printf '%s' '${escapedContent}' > "${destinationPath}"`]);
}
} else { // if (file.content) {
const copyOutput = await copyCommand.execute(); // const writeOutput = await writeCommand.execute();
if (copyOutput.code === 0) { // if (writeOutput.code === 0) {
console.log(`File ${file.source} copied successfully to ${destinationPath}`); // console.log(`File ${file.destination} created successfully at ${destinationPath}`);
} else { // } else {
console.error(`Failed to copy file ${file.source} to ${destinationPath}:`, copyOutput.stderr); // console.error(`Failed to create file ${file.destination} at ${destinationPath}:`, writeOutput.stderr);
return { success: false, message: 'Failed to register' }; // 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 { } else {
for (const file of filesToCopy) { for (const file of filesToCopy) {
const sourcePath = await join(resourceDirPath, file.source); const sourcePath = await join(resourceDirPath, file.source);

View File

@@ -20,7 +20,8 @@ export default function usePotServer() {
const isFlatpak = await invoke<boolean>('is_flatpak'); const isFlatpak = await invoke<boolean>('is_flatpak');
const runCommand = isFlatpak const runCommand = isFlatpak
? Command.create('sh', [ ? Command.create('sh', [
'-c', `/app/bin/neodlp-pot server --port ${port ? port.toString() : potServerPort.toString()}` '-c',
`neodlp-pot server --port ${port ? port.toString() : potServerPort.toString()}`
]) ])
: Command.sidecar('binaries/neodlp-pot', [ : Command.sidecar('binaries/neodlp-pot', [
'server', 'server',