mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-23 01:55:49 +05:30
Compare commits
3 Commits
bd21650394
...
main
@@ -20,7 +20,7 @@ const versions = {
|
|||||||
'ffmpeg-ffprobe': 'latest',
|
'ffmpeg-ffprobe': 'latest',
|
||||||
'deno': '2.7.7',
|
'deno': '2.7.7',
|
||||||
'aria2c': '1.37.0',
|
'aria2c': '1.37.0',
|
||||||
'neodlp-pot': '0.7.2'
|
'neodlp-pot': '0.8.1'
|
||||||
};
|
};
|
||||||
|
|
||||||
const binaries = {
|
const binaries = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
__version__ = '1.3.0'
|
__version__ = '0.8.1'
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
import json
|
import json
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
"externalBin": [
|
"externalBin": [
|
||||||
"binaries/deno"
|
"binaries/deno",
|
||||||
|
"binaries/neodlp-pot"
|
||||||
],
|
],
|
||||||
"resources": {
|
"resources": {
|
||||||
"resources/plugins/yt-dlp-plugins/": "yt-dlp-plugins/"
|
"resources/plugins/yt-dlp-plugins/": "yt-dlp-plugins/"
|
||||||
|
|||||||
@@ -1276,7 +1276,7 @@ function AppDelaySettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function AppPoTokenSettings() {
|
function AppPoTokenSettings() {
|
||||||
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
|
// 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);
|
||||||
@@ -1349,7 +1349,7 @@ function AppPoTokenSettings() {
|
|||||||
await stopPotServer();
|
await stopPotServer();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
disabled={useCustomCommands || isStartingPotServer || isChangingPotServerPort || isFlatpak}
|
disabled={useCustomCommands || isStartingPotServer || isChangingPotServerPort /*|| isFlatpak*/}
|
||||||
/>
|
/>
|
||||||
<Label htmlFor="use-potoken">Use PO Token</Label>
|
<Label htmlFor="use-potoken">Use PO Token</Label>
|
||||||
</div>
|
</div>
|
||||||
@@ -1375,7 +1375,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 || isFlatpak}
|
disabled={useCustomCommands || !usePotoken /*|| isFlatpak*/}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1388,7 +1388,7 @@ function AppPoTokenSettings() {
|
|||||||
<FormField
|
<FormField
|
||||||
control={potServerPortForm.control}
|
control={potServerPortForm.control}
|
||||||
name="port"
|
name="port"
|
||||||
disabled={!usePotoken || isChangingPotServerPort || isStartingPotServer || isFlatpak}
|
disabled={!usePotoken || isChangingPotServerPort || isStartingPotServer /*|| isFlatpak*/}
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="w-full">
|
<FormItem className="w-full">
|
||||||
<FormControl>
|
<FormControl>
|
||||||
@@ -1407,7 +1407,7 @@ function AppPoTokenSettings() {
|
|||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!watchedPotServerPort || Number(watchedPotServerPort) === potServerPort || Object.keys(potServerPortFormErrors).length > 0 || !usePotoken || useCustomCommands || isChangingPotServerPort || isStartingPotServer || isFlatpak}
|
disabled={!watchedPotServerPort || Number(watchedPotServerPort) === potServerPort || Object.keys(potServerPortFormErrors).length > 0 || !usePotoken || useCustomCommands || isChangingPotServerPort || isStartingPotServer /*|| isFlatpak*/}
|
||||||
>
|
>
|
||||||
{isChangingPotServerPort ? (
|
{isChangingPotServerPort ? (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { relaunch as relaunchApp } from "@tauri-apps/plugin-process";
|
|||||||
import { useSettingsPageStatesStore } from "@/services/store";
|
import { useSettingsPageStatesStore } from "@/services/store";
|
||||||
import { useLogger } from "@/helpers/use-logger";
|
import { useLogger } from "@/helpers/use-logger";
|
||||||
import { sendNotification } from '@tauri-apps/plugin-notification';
|
import { sendNotification } from '@tauri-apps/plugin-notification';
|
||||||
|
import usePotServer from "@/helpers/use-pot-server";
|
||||||
|
|
||||||
export default function useAppUpdater() {
|
export default function useAppUpdater() {
|
||||||
const setIsCheckingAppUpdate = useSettingsPageStatesStore(state => state.setIsCheckingAppUpdate);
|
const setIsCheckingAppUpdate = useSettingsPageStatesStore(state => state.setIsCheckingAppUpdate);
|
||||||
@@ -12,6 +13,9 @@ export default function useAppUpdater() {
|
|||||||
const setDownloadProgress = useSettingsPageStatesStore(state => state.setAppUpdateDownloadProgress);
|
const setDownloadProgress = useSettingsPageStatesStore(state => state.setAppUpdateDownloadProgress);
|
||||||
const enableNotifications = useSettingsPageStatesStore(state => state.settings.enable_notifications);
|
const enableNotifications = useSettingsPageStatesStore(state => state.settings.enable_notifications);
|
||||||
const updateNotification = useSettingsPageStatesStore(state => state.settings.update_notification);
|
const updateNotification = useSettingsPageStatesStore(state => state.settings.update_notification);
|
||||||
|
const isRunningPotServer = useSettingsPageStatesStore(state => state.isRunningPotServer);
|
||||||
|
|
||||||
|
const { stopPotServer } = usePotServer();
|
||||||
const LOG = useLogger();
|
const LOG = useLogger();
|
||||||
|
|
||||||
const checkForAppUpdate = async () => {
|
const checkForAppUpdate = async () => {
|
||||||
@@ -38,6 +42,10 @@ export default function useAppUpdater() {
|
|||||||
|
|
||||||
const downloadAndInstallAppUpdate = async (update: Update) => {
|
const downloadAndInstallAppUpdate = async (update: Update) => {
|
||||||
setIsUpdating(true);
|
setIsUpdating(true);
|
||||||
|
if (isRunningPotServer) {
|
||||||
|
LOG.info('NEODLP', 'Stopping POT Server before starting app update');
|
||||||
|
await stopPotServer();
|
||||||
|
}
|
||||||
LOG.info('NEODLP', `Downloading and installing app update v${update.version}`);
|
LOG.info('NEODLP', `Downloading and installing app update v${update.version}`);
|
||||||
let downloaded = 0;
|
let downloaded = 0;
|
||||||
let contentLength: number | undefined = 0;
|
let contentLength: number | undefined = 0;
|
||||||
|
|||||||
@@ -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,47 +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.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_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/' },
|
{ 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) {
|
||||||
// Skip linux registration for Flatpak
|
// Skip linux registration for Flatpak
|
||||||
console.log('Flatpak sandbox detected! Skipping Linux registration...');
|
// console.log('Flatpak sandbox detected! Skipping Linux registration...');
|
||||||
|
|
||||||
// for (const file of filesToCopyFlatpak) {
|
for (const file of filesToCopyFlatpak) {
|
||||||
// const sourcePath = await join(resourceDirPath, file.source);
|
const sourcePath = await join(resourceDirPath, file.source);
|
||||||
// const destinationDir = await join(homeDirPath, file.dir);
|
const destinationDir = await join(homeDirPath, file.dir);
|
||||||
// const destinationPath = await join(homeDirPath, file.destination);
|
const destinationPath = await join(homeDirPath, file.destination);
|
||||||
// const escapedContent = file.content?.replace(/'/g, `'\\''`) || '';
|
const escapedContent = file.content?.replace(/'/g, `'\\''`) || '';
|
||||||
// const copyCommand = Command.create('sh', ['-c', `mkdir -p "${destinationDir}" && cp "${sourcePath}" "${destinationPath}"`]);
|
const copyCommand = Command.create('sh', ['-c', `mkdir -p "${destinationDir}" && cp "${sourcePath}" "${destinationPath}"`]);
|
||||||
// const writeCommand = Command.create('sh', ['-c', `printf '%s' '${escapedContent}' > "${destinationPath}"`]);
|
const writeCommand = Command.create('sh', ['-c', `printf '%s' '${escapedContent}' > "${destinationPath}"`]);
|
||||||
|
|
||||||
// if (file.content) {
|
if (file.content) {
|
||||||
// const writeOutput = await writeCommand.execute();
|
const writeOutput = await writeCommand.execute();
|
||||||
// if (writeOutput.code === 0) {
|
if (writeOutput.code === 0) {
|
||||||
// console.log(`File ${file.destination} created successfully at ${destinationPath}`);
|
console.log(`File ${file.destination} created successfully at ${destinationPath}`);
|
||||||
// } else {
|
} else {
|
||||||
// console.error(`Failed to create file ${file.destination} at ${destinationPath}:`, writeOutput.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 {
|
} else {
|
||||||
// const copyOutput = await copyCommand.execute();
|
const copyOutput = await copyCommand.execute();
|
||||||
// if (copyOutput.code === 0) {
|
if (copyOutput.code === 0) {
|
||||||
// console.log(`File ${file.source} copied successfully to ${destinationPath}`);
|
console.log(`File ${file.source} copied successfully to ${destinationPath}`);
|
||||||
// } else {
|
} else {
|
||||||
// console.error(`Failed to copy file ${file.source} to ${destinationPath}:`, copyOutput.stderr);
|
console.error(`Failed to copy file ${file.source} to ${destinationPath}:`, copyOutput.stderr);
|
||||||
// return { success: false, message: 'Failed to register' };
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user