1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-27 20:45:49 +05:30

40 Commits

47 changed files with 1633 additions and 1777 deletions

15
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: neosubhamoy
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
.github/images/flathub/downloader.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
.github/images/flathub/settings.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

@@ -1,10 +1,10 @@
### ✨ Changelog ### ✨ Changelog
- Added delay/sleep configuration settings (delay is now also configurable on search) - Added filename sanitization settings
- Added support for YouTube PO Token generation (based on [bgutil-ytdlp-pot-provider-rs](https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs)) - Fixed po-token server process not terminating on app update
- Implemented custom app titlebar on windows and linux - Fixed yt-dlp auto-update on linux flatpak
- Further improved and persisted app logs (stored in [platform specific log directory](https://v2.tauri.app/plugin/logging/#persisting-logs)) - Fixed potoken server on linux flatpak
- Fixed webview window creation is failing on wayland with nvidia gpu - Improved linux package dependencies
- Other minor fixes and improvements - Other minor fixes and improvements
### 📝 Notes ### 📝 Notes
@@ -13,7 +13,7 @@
> Users are always adviced to complete/cancel all paused downloads before updating to a newer version, otherwise paused downloads may not resume properly and re-start from the begining. > Users are always adviced to complete/cancel all paused downloads before updating to a newer version, otherwise paused downloads may not resume properly and re-start from the begining.
> [!WARNING] > [!WARNING]
> Linux users make sure `yt-dlp` and `deno` is not installed in your distro (otherwise you will get package installation conflict). Don't worry, You can still use yt-dlp cli as before (the only difference is that now it will be installed and auto-updated by neo-dlp, which You can also disable from neo-dlp Settings if you don't want to auto-update yt-dlp) > Linux users make sure `yt-dlp` and `deno` is not installed in your distro (otherwise you will get package installation conflict). Don't worry, You can still use yt-dlp cli as before (the only difference is that now it will be installed and auto-updated by neodlp, which You can also disable from neodlp settings if you don't want to auto-update yt-dlp) (ignore this if you are installing AppImage/Flatpak)
> This is an Un-Signed Build (Windows doesn't trust this Certificate so, it may flag this as malicious software, in that case, disable Windows SmartScreen and Defender, install it, and then re-enable them) > This is an Un-Signed Build (Windows doesn't trust this Certificate so, it may flag this as malicious software, in that case, disable Windows SmartScreen and Defender, install it, and then re-enable them)
@@ -21,13 +21,13 @@
### 📦 Shipped Binaries ### 📦 Shipped Binaries
| yt-dlp (updateable) | ffmpeg | ffprobe | aria2c | deno | bgutil-pot-rs | | yt-dlp (updateable) | ffmpeg | aria2c | deno | bgutil-pot-rs |
| :---- | :---- | :---- | :---- | :---- | :---- | | :---- | :---- | :---- | :---- | :---- |
| v2026.02.17.233631 (nightly) | v7.1.1 | v7.1.1 | v1.37.0 | v2.6.10 | v0.7.1-1.2.2 | | v2026.03.21.233500 (nightly) | v8.0.1 | v1.37.0 | v2.7.8 | v0.8.1 |
> ‼️ Linux builds (deb, rpm) does not ships with `ffmpeg` and `ffprobe` (though it will be auto installed as a dependency by your package manager, if you are on fedora make sure to [enable rpmfusion free+nonfree repos](https://docs.fedoraproject.org/en-US/quick-docs/rpmfusion-setup/#_enabling_the_rpm_fusion_repositories_using_command_line_utilities) before installing the rpm package) > ‼️ Linux builds (deb, rpm) does not ships with `ffmpeg` and `aria2c` (though it will be auto installed as a dependency by your package manager, if you are on fedora make sure to [enable rpmfusion free+nonfree repos](https://docs.fedoraproject.org/en-US/quick-docs/rpmfusion-setup/#_enabling_the_rpm_fusion_repositories_using_command_line_utilities) before installing the rpm package)
> ‼️ MacOS builds (dmg, app) does not ships with `aria2c`, If you want to use [aria2](https://formulae.brew.sh/formula/aria2) install it via [homebrew](https://brew.sh) > ‼️ MacOS builds (dmg, app) does not ships with `aria2c`, If you want to use [aria2](https://formulae.brew.sh/formula/aria2) install it via [Homebrew](https://brew.sh) (though it will be auto installed as a dependency if you install neodlp via Homebrew)
### ⬇️ Download Section ### ⬇️ Download Section
@@ -40,9 +40,10 @@
> 🪟 Windows x86_64 binary also works on ARM64 (Windows on ARM) devices with emulation (Not planning to release native Windows ARM64 build anytime soon as, x86_64 one works fine on ARM64 without noticeable performance impact) > 🪟 Windows x86_64 binary also works on ARM64 (Windows on ARM) devices with emulation (Not planning to release native Windows ARM64 build anytime soon as, x86_64 one works fine on ARM64 without noticeable performance impact)
> 🚫 Linux AppImage builds are experimental and does not support neodlp's browser intergration features due to it's sandboxed nature. Also, don't run the AppImage with portable (.home, .config) folders, it will break things (it is highly recommended to use native [deb, rpm, AUR] builds if possible for the full experiance, otherwise AppImages are good for trying out NeoDLP without installing) > 🚫 Linux AppImage builds are experimental and does not support neodlp's browser intergration features and yt-dlp updates due to it's limitations. Also, don't run the AppImage with portable (.home, .config) folders, it will break things (it is highly recommended to use native [DEB, RPM, AUR] builds if possible for the full experiance, otherwise AppImages are good for trying out NeoDLP without installing)
> ⚠️ MacOS ARM64 binary downloads are experimental and may not open on Apple Silicon Macs if downloaded from browser (You will get 'Damaged File' error) it's because the binaries are not signed (signing MacOS binaries requires 99$/year Apple Developer Account subscription, which I can't afford RN!) and Apple Silicon Macs don't allow unsigned apps (downloaded from browser) to be installed on the system. If you want to use NeoDLP on your Apple Silicon Macs, There are few ways you can bypass these restrictions: > ⚠️ MacOS ARM64 binary downloads are experimental and may not open on Apple Silicon Macs if downloaded from browser (You will get 'Damaged File' error) it's because the binaries are not signed (signing MacOS binaries requires 99$/year Apple Developer Account subscription, which I can't afford RN!) and Apple Silicon Macs don't allow unsigned apps (downloaded from browser) to be installed on the system. If you want to use NeoDLP on your Apple Silicon Macs, There are few ways you can bypass these restrictions:
> 1. Using our automated [Curl-Bash Installer](https://neodlp.neosubhamoy.com/download) (Recommended) > 1. Using [Homebrew](https://neodlp.neosubhamoy.com/download) (Recommended)
> 2. You can also manually remove the .dmg file/.app folder from macOS quarantine using these commands: `xattr -d com.apple.quarantine NeoDLP_x.x.x_aarch64.dmg` (for .dmg file) -OR- `xattr -r -d com.apple.quarantine /Applications/NeoDLP.app` (for .app folder) > 2. Using our automated [Curl-Bash Installer](https://neodlp.neosubhamoy.com/download)
> 3. Or you can [compile NeoDLP from source](https://github.com/neosubhamoy/neodlp?tab=readme-ov-file#%EF%B8%8F-building-from-source) in your Mac (Then you don't have to download the pre-compiled binaries at all, though it is a much longer process and is intended for advanced users only) > 3. You can also manually remove the .dmg file/.app folder from macOS quarantine using these commands: `xattr -d com.apple.quarantine NeoDLP_x.x.x_aarch64.dmg` (for .dmg file) -OR- `xattr -r -d com.apple.quarantine /Applications/NeoDLP.app` (for .app folder)
> 4. Or you can [compile NeoDLP from source](https://github.com/neosubhamoy/neodlp?tab=readme-ov-file#%EF%B8%8F-building-from-source) in your Mac (Then you don't have to download the pre-compiled binaries at all, though it is a much longer process and is intended for advanced users only)

View File

@@ -10,9 +10,10 @@ Cross-platform Video/Audio Downloader Desktop App based on YT-DLP with Modern UI
[![github license](https://img.shields.io/github/license/neosubhamoy/neodlp?color=blue&style=for-the-badge)](https://github.com/neosubhamoy/neodlp/blob/main/LICENSE) [![github license](https://img.shields.io/github/license/neosubhamoy/neodlp?color=blue&style=for-the-badge)](https://github.com/neosubhamoy/neodlp/blob/main/LICENSE)
> [!TIP] > [!TIP]
> **🥰 Liked this project? Please consider giving it a Star (🌟) on github to show us your appreciation and help the algorythm recommend this project to even more awesome people like you!** > **🥰 Liked this project? Please consider giving it a star (🌟) on github to show us your appreciation and help the algorythm recommend this project to even more awesome people like you!**
[![winget version](https://img.shields.io/winget/v/neosubhamoy.neodlp?color=lime-green&style=flat-square)](https://github.com/microsoft/winget-pkgs/tree/master/manifests/n/neosubhamoy/neodlp) [![winget version](https://img.shields.io/winget/v/neosubhamoy.neodlp?color=lime-green&style=flat-square)](https://github.com/microsoft/winget-pkgs/tree/master/manifests/n/neosubhamoy/neodlp)
[![flathub version](https://img.shields.io/flathub/v/com.neosubhamoy.neodlp?color=lime-green&style=flat-square)](https://flathub.org/en/apps/com.neosubhamoy.neodlp)
[![aur version](https://img.shields.io/aur/version/neodlp?color=lime-green&style=flat-square)](https://aur.archlinux.org/packages/neodlp) [![aur version](https://img.shields.io/aur/version/neodlp?color=lime-green&style=flat-square)](https://aur.archlinux.org/packages/neodlp)
@@ -51,8 +52,8 @@ After installing the extension you can do the following directly from the browse
## 💻 Supported Platforms ## 💻 Supported Platforms
- Windows (10 / 11) - Windows (10 / 11)
- Linux (Debian / Fedora / RHEL / SUSE / Arch Linux base) - Linux (Mostly all modern distros)
- MacOS (>11) - MacOS (>=11)
## 🤝 External Dependencies ## 🤝 External Dependencies
@@ -85,8 +86,9 @@ After installing the extension you can do the following directly from the browse
| Windows x86_64 / ARM64 | WinGet | `winget install neosubhamoy.neodlp` | | Windows x86_64 / ARM64 | WinGet | `winget install neosubhamoy.neodlp` |
| MacOS x86_64 / ARM64 | Homebrew | `brew install neosubhamoy/tap/neodlp` | | MacOS x86_64 / ARM64 | Homebrew | `brew install neosubhamoy/tap/neodlp` |
| MacOS x86_64 / ARM64 | Curl-Bash Installer | `curl -sSL https://neodlp.neosubhamoy.com/macos_installer.sh \| bash` | | MacOS x86_64 / ARM64 | Curl-Bash Installer | `curl -sSL https://neodlp.neosubhamoy.com/macos_installer.sh \| bash` |
| Linux x86_64 / ARM64 | Curl-Bash Installer | `curl -sSL https://neodlp.neosubhamoy.com/linux_installer.sh \| bash` | | Linux x86_64 / ARM64 (Flatpak) | Flathub | `flatpak install flathub com.neosubhamoy.neodlp` |
| Arch Linux x86_64 / ARM64 | AUR | `yay -S neodlp` or `paru -S neodlp` | | Linux x86_64 / ARM64 (Native) | Curl-Bash Installer | `curl -sSL https://neodlp.neosubhamoy.com/linux_installer.sh \| bash` |
| Arch Linux x86_64 / ARM64 (Native) | AUR | `yay -S neodlp` or `paru -S neodlp` |
## 🧪 Package Testing Status ## 🧪 Package Testing Status
@@ -113,18 +115,6 @@ Though NeoDLP is supported on most platforms but not all packages are tested on
</details> </details>
## 💝 Support the Development
NeoDLP is and will be always FREE to Use and Open-Sourced for Everyone. On the other hand the developent process of NeoDLP takes lots of time, effort and even sometimes money! So, if you appriciate my work and have the ability to donate, then please consider supporting the development by donating (even a very small donation matters and helps NeoDLP to be a better product!) Your support is the key to my motivation...🤗
<a href="https://buymeacoffee.com/neosubhamoy" target="_blank" title="buymeacoffee">
<img src="https://iili.io/JoQ0zN9.md.png" alt="buymeacoffee-orange-badge" style="width: 150px;">
</a>
<br></br>
> [!NOTE]
> You can also donate via UPI by sending donations to this UPI ID directly: **subhamoybiswas636-2@oksbi**
## 🪜 Roadmap ## 🪜 Roadmap
- [x] Add support for yt-dlp - [x] Add support for yt-dlp
@@ -189,6 +179,7 @@ Noticed any Bug? or Want to give us some suggetions? Always feel free to let us
- [SourceForge (Releases Only)](https://sourceforge.net/projects/neodlp) - [SourceForge (Releases Only)](https://sourceforge.net/projects/neodlp)
- Official Distribution Channels - Official Distribution Channels
- [WinGet (for Windows)](https://github.com/microsoft/winget-pkgs/tree/master/manifests/n/neosubhamoy/neodlp) - [WinGet (for Windows)](https://github.com/microsoft/winget-pkgs/tree/master/manifests/n/neosubhamoy/neodlp)
- [Flathub (for Linux)](https://flathub.org/en/apps/com.neosubhamoy.neodlp)
- [AUR (for Arch Linux)](https://aur.archlinux.org/packages/neodlp) - [AUR (for Arch Linux)](https://aur.archlinux.org/packages/neodlp)
- Related Projects - Related Projects
- [NeoDLP Extension](https://github.com/neosubhamoy/neodlp-extension) - [NeoDLP Extension](https://github.com/neosubhamoy/neodlp-extension)

View File

@@ -2,7 +2,7 @@
Type=Application Type=Application
Name=NeoDLP 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 Icon=com.neosubhamoy.neodlp
Exec=neodlp Exec=neodlp
Terminal=false Terminal=false

View File

@@ -2,30 +2,52 @@
<component type="desktop-application"> <component type="desktop-application">
<id>com.neosubhamoy.neodlp</id> <id>com.neosubhamoy.neodlp</id>
<name>NeoDLP</name> <name>NeoDLP</name>
<summary>Modern video/audio downloader based on yt-dlp with browser integration</summary> <summary>Modern feature-rich video/audio downloader based on yt-dlp</summary>
<developer_name>Subhamoy Biswas</developer_name> <developer id="com.neosubhamoy">
<name>Subhamoy Biswas</name>
</developer>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license> <project_license>MIT</project_license>
<url type="homepage">https://neodlp.neosubhamoy.com</url> <url type="homepage">https://neodlp.neosubhamoy.com</url>
<url type="vcs-browser">https://github.com/neosubhamoy/neodlp</url>
<url type="bugtracker">https://github.com/neosubhamoy/neodlp/issues</url> <url type="bugtracker">https://github.com/neosubhamoy/neodlp/issues</url>
<description> <description>
<p> <p>
NeoDLP is a cross-platform desktop application designed for downloading videos and audio from various online sources based on yt-dlp. 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.
</p> </p>
</description> </description>
<launchable type="desktop-id">com.neosubhamoy.neodlp.desktop</launchable> <launchable type="desktop-id">com.neosubhamoy.neodlp.desktop</launchable>
<screenshots> <screenshots>
<screenshot type="default"> <screenshot type="default">
<image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/downloader.png</image> <image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/flathub/downloader.png</image>
<caption>NeoDLP Downloader</caption> <caption>Downloader page of NeoDLP</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/flathub/completed-downloads.png</image>
<caption>Completed downloads page of NeoDLP</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/flathub/ongoing-downloads.png</image>
<caption>Ongoing downloads page of NeoDLP</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/flathub/settings.png</image>
<caption>Settings page of NeoDLP</caption>
</screenshot> </screenshot>
</screenshots> </screenshots>
<branding>
<color type="primary" scheme_preference="light">#404559</color>
<color type="primary" scheme_preference="dark">#404559</color>
</branding>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<releases> <releases>
<release version="0.4.2" date="2026-02-23"> <release version="0.4.4" date="2026-03-27">
<url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.2</url> <url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.4</url>
</release>
<release version="0.4.3" date="2026-03-07">
<url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.3</url>
</release> </release>
</releases> </releases>
</component> </component>

View File

@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/neodlp.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NeoDLP</title> <title>NeoDLP</title>
</head> </head>

1737
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "neodlp", "name": "neodlp",
"private": true, "private": true,
"version": "0.4.1", "version": "0.4.4",
"description": "Cross-platform Video/Audio Downloader Desktop App based on YT-DLP with Modern UI and Browser Integration", "description": "Cross-platform Video/Audio Downloader Desktop App based on YT-DLP with Modern UI and Browser Integration",
"type": "module", "type": "module",
"scripts": { "scripts": {
@@ -21,11 +21,11 @@
}, },
"dependencies": { "dependencies": {
"@hookform/resolvers": "^5.2.2", "@hookform/resolvers": "^5.2.2",
"@tanstack/devtools-vite": "^0.5.1", "@tanstack/devtools-vite": "^0.6.0",
"@tanstack/react-devtools": "^0.9.6", "@tanstack/react-devtools": "^0.10.0",
"@tanstack/react-pacer": "^0.20.0", "@tanstack/react-pacer": "^0.20.0",
"@tanstack/react-pacer-devtools": "^0.5.2", "@tanstack/react-pacer-devtools": "^0.5.5",
"@tanstack/react-query": "^5.90.21", "@tanstack/react-query": "^5.91.2",
"@tanstack/react-query-devtools": "^5.91.3", "@tanstack/react-query-devtools": "^5.91.3",
"@tauri-apps/api": "^2.10.1", "@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-clipboard-manager": "^2.3.2", "@tauri-apps/plugin-clipboard-manager": "^2.3.2",
@@ -41,32 +41,30 @@
"@tauri-apps/plugin-updater": "^2.10.0", "@tauri-apps/plugin-updater": "^2.10.0",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"lucide-react": "^0.574.0", "lucide-react": "^0.577.0",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"radix-ui": "^1.4.3", "radix-ui": "^1.4.3",
"react": "^19.2.4", "react": "^19.2.4",
"react-dom": "^19.2.4", "react-dom": "^19.2.4",
"react-hook-form": "^7.71.1", "react-hook-form": "^7.71.2",
"react-resizable-panels": "^4.6.4", "react-resizable-panels": "^4.7.3",
"react-router-dom": "^7.13.0", "react-router-dom": "^7.13.1",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"tailwind-merge": "^3.4.1", "tailwind-merge": "^3.5.0",
"ulid": "^3.0.2", "ulid": "^3.0.2",
"zod": "^4.3.6", "zod": "^4.3.6",
"zustand": "^5.0.11" "zustand": "^5.0.12"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/postcss": "^4.2.0", "@tailwindcss/vite": "^4.2.2",
"@tailwindcss/vite": "^4.2.0", "@tauri-apps/cli": "^2.10.1",
"@tauri-apps/cli": "^2.10.0", "@types/node": "^25.5.0",
"@types/node": "^25.2.3",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4", "@vitejs/plugin-react": "^6.0.1",
"postcss": "^8.5.6", "tailwindcss": "^4.2.2",
"tailwindcss": "^4.2.0",
"tw-animate-css": "^1.4.0", "tw-animate-css": "^1.4.0",
"typescript": "~5.9.3", "typescript": "~5.9.3",
"vite": "^7.3.1" "vite": "^8.0.1"
} }
} }

View File

@@ -1,5 +0,0 @@
export default {
plugins: {
"@tailwindcss/postcss": {},
},
}

11
public/neodlp.svg Normal file
View File

@@ -0,0 +1,11 @@
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="1024" height="1024" rx="200" fill="url(#paint0_linear_10_2)"/>
<path d="M529.252 811.098C519.472 820.96 503.528 820.96 493.748 811.098L256.265 571.603C240.619 555.824 251.796 529 274.017 529H748.983C771.204 529 782.381 555.824 766.735 571.603L529.252 811.098Z" fill="#FAFAFA"/>
<rect x="355" y="222" width="313" height="346" rx="25" fill="#FAFAFA"/>
<defs>
<linearGradient id="paint0_linear_10_2" x1="129.5" y1="148.5" x2="921" y2="863" gradientUnits="userSpaceOnUse">
<stop stop-color="#4444FF"/>
<stop offset="1" stop-color="#FF43D0"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 687 B

View File

@@ -1,6 +0,0 @@
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,51 +0,0 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { execSync } from 'child_process';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const projectRoot = path.resolve(__dirname, '..');
// Define array of binary source directories
const binSrcDirs = [
path.join(projectRoot, 'src-tauri', 'binaries'),
];
function makeFilesExecutable() {
let totalCount = 0;
let successDirs = 0;
for (const binSrc of binSrcDirs) {
try {
if (!fs.existsSync(binSrc)) {
console.error(`Binaries directory does not exist: ${binSrc}`);
continue;
}
const files = fs.readdirSync(binSrc);
const nonExeFiles = files.filter(file => !file.endsWith('.exe'));
let count = 0;
for (const file of nonExeFiles) {
const filePath = path.join(binSrc, file);
if (fs.statSync(filePath).isFile()) {
execSync(`chmod +x "${filePath}"`);
console.log(`Made executable: ${path.relative(__dirname, filePath)}`);
count++;
}
}
console.log(`Successfully made ${count} files executable in ${binSrc}`);
totalCount += count;
successDirs++;
} catch (error) {
console.error(`Error processing directory ${binSrc}: ${error.message}`);
}
}
console.log(`\nSummary: Made ${totalCount} files executable across ${successDirs} directories`);
}
console.log(`RUNNING: 🛠️ Build Script --> chmod.js`);
makeFilesExecutable();

View File

@@ -16,11 +16,11 @@ const targetPlatform = process.argv[2];
const targetBin = process.argv[3]; const targetBin = process.argv[3];
const versions = { const versions = {
'yt-dlp': 'latest', 'yt-dlp': '2026.03.21.233500',
'ffmpeg-ffprobe': 'latest', 'ffmpeg-ffprobe': 'latest',
'deno': 'latest', 'deno': '2.7.8',
'aria2c': '1.37.0', 'aria2c': '1.37.0',
'neodlp-pot': 'latest' 'neodlp-pot': '0.8.1'
}; };
const binaries = { const binaries = {
@@ -239,7 +239,7 @@ const binaries = {
{ {
name: 'deno-x86_64-pc-windows-msvc', name: 'deno-x86_64-pc-windows-msvc',
platform: 'win32', platform: 'win32',
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-x86_64-pc-windows-msvc.zip`, url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/v'+versions['deno'] : ''}/deno-x86_64-pc-windows-msvc.zip`,
src: path.join(downloadDir, 'deno-x86_64-pc-windows-msvc.zip'), src: path.join(downloadDir, 'deno-x86_64-pc-windows-msvc.zip'),
dest: null, dest: null,
archive: { archive: {
@@ -259,7 +259,7 @@ const binaries = {
{ {
name: 'deno-x86_64-unknown-linux-gnu', name: 'deno-x86_64-unknown-linux-gnu',
platform: 'linux', platform: 'linux',
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-x86_64-unknown-linux-gnu.zip`, url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/v'+versions['deno'] : ''}/deno-x86_64-unknown-linux-gnu.zip`,
src: path.join(downloadDir, 'deno-x86_64-unknown-linux-gnu.zip'), src: path.join(downloadDir, 'deno-x86_64-unknown-linux-gnu.zip'),
dest: null, dest: null,
archive: { archive: {
@@ -279,7 +279,7 @@ const binaries = {
{ {
name: 'deno-aarch64-unknown-linux-gnu', name: 'deno-aarch64-unknown-linux-gnu',
platform: 'linux', platform: 'linux',
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-aarch64-unknown-linux-gnu.zip`, url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/v'+versions['deno'] : ''}/deno-aarch64-unknown-linux-gnu.zip`,
src: path.join(downloadDir, 'deno-aarch64-unknown-linux-gnu.zip'), src: path.join(downloadDir, 'deno-aarch64-unknown-linux-gnu.zip'),
dest: null, dest: null,
archive: { archive: {
@@ -299,7 +299,7 @@ const binaries = {
{ {
name: 'deno-x86_64-apple-darwin', name: 'deno-x86_64-apple-darwin',
platform: 'darwin', platform: 'darwin',
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-x86_64-apple-darwin.zip`, url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/v'+versions['deno'] : ''}/deno-x86_64-apple-darwin.zip`,
src: path.join(downloadDir, 'deno-x86_64-apple-darwin.zip'), src: path.join(downloadDir, 'deno-x86_64-apple-darwin.zip'),
dest: null, dest: null,
archive: { archive: {
@@ -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: {
@@ -403,7 +403,7 @@ const binaries = {
{ {
name: 'neodlp-pot-x86_64-pc-windows-msvc', name: 'neodlp-pot-x86_64-pc-windows-msvc',
platform: 'win32', platform: 'win32',
url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/'+versions['neodlp-pot'] : ''}/bgutil-pot-windows-x86_64.exe`, url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/v'+versions['neodlp-pot'] : ''}/bgutil-pot-windows-x86_64.exe`,
src: path.join(downloadDir, 'bgutil-pot-windows-x86_64.exe'), src: path.join(downloadDir, 'bgutil-pot-windows-x86_64.exe'),
dest: [ dest: [
path.join(binDir, 'neodlp-pot-x86_64-pc-windows-msvc.exe') path.join(binDir, 'neodlp-pot-x86_64-pc-windows-msvc.exe')
@@ -416,7 +416,7 @@ const binaries = {
{ {
name: 'neodlp-pot-x86_64-unknown-linux-gnu', name: 'neodlp-pot-x86_64-unknown-linux-gnu',
platform: 'linux', platform: 'linux',
url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/'+versions['neodlp-pot'] : ''}/bgutil-pot-linux-x86_64`, url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/v'+versions['neodlp-pot'] : ''}/bgutil-pot-linux-x86_64`,
src: path.join(downloadDir, 'bgutil-pot-linux-x86_64'), src: path.join(downloadDir, 'bgutil-pot-linux-x86_64'),
dest: [ dest: [
path.join(binDir, 'neodlp-pot-x86_64-unknown-linux-gnu') path.join(binDir, 'neodlp-pot-x86_64-unknown-linux-gnu')
@@ -429,7 +429,7 @@ const binaries = {
{ {
name: 'neodlp-pot-aarch64-unknown-linux-gnu', name: 'neodlp-pot-aarch64-unknown-linux-gnu',
platform: 'linux', platform: 'linux',
url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/'+versions['neodlp-pot'] : ''}/bgutil-pot-linux-aarch64`, url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/v'+versions['neodlp-pot'] : ''}/bgutil-pot-linux-aarch64`,
src: path.join(downloadDir, 'bgutil-pot-linux-aarch64'), src: path.join(downloadDir, 'bgutil-pot-linux-aarch64'),
dest: [ dest: [
path.join(binDir, 'neodlp-pot-aarch64-unknown-linux-gnu') path.join(binDir, 'neodlp-pot-aarch64-unknown-linux-gnu')
@@ -442,7 +442,7 @@ const binaries = {
{ {
name: 'neodlp-pot-x86_64-apple-darwin', name: 'neodlp-pot-x86_64-apple-darwin',
platform: 'darwin', platform: 'darwin',
url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/'+versions['neodlp-pot'] : ''}/bgutil-pot-macos-x86_64`, url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/v'+versions['neodlp-pot'] : ''}/bgutil-pot-macos-x86_64`,
src: path.join(downloadDir, 'bgutil-pot-macos-x86_64'), src: path.join(downloadDir, 'bgutil-pot-macos-x86_64'),
dest: [ dest: [
path.join(binDir, 'neodlp-pot-x86_64-apple-darwin') path.join(binDir, 'neodlp-pot-x86_64-apple-darwin')
@@ -455,7 +455,7 @@ const binaries = {
{ {
name: 'neodlp-pot-aarch64-apple-darwin', name: 'neodlp-pot-aarch64-apple-darwin',
platform: 'darwin', platform: 'darwin',
url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/'+versions['neodlp-pot'] : ''}/bgutil-pot-macos-aarch64`, url: `https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases${versions['neodlp-pot'] === 'latest' ? '/latest' : ''}/download${versions['neodlp-pot'] !== 'latest' ? '/v'+versions['neodlp-pot'] : ''}/bgutil-pot-macos-aarch64`,
src: path.join(downloadDir, 'bgutil-pot-macos-aarch64'), src: path.join(downloadDir, 'bgutil-pot-macos-aarch64'),
dest: [ dest: [
path.join(binDir, 'neodlp-pot-aarch64-apple-darwin') path.join(binDir, 'neodlp-pot-aarch64-apple-darwin')

View File

@@ -1,57 +0,0 @@
import fs from 'fs';
import path from 'path';
import { execFile } from 'child_process';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const projectRoot = path.resolve(__dirname, '..');
console.log(`RUNNING: 🛠️ Build Script --> update-yt-dlp.js`);
// Get the platform triple from command line arguments
const platformTriple = process.argv[2];
if (!platformTriple) {
console.error('Error: Please provide a platform triple');
process.exit(1);
}
// Define the binaries directory
const binariesDir = path.join(projectRoot, 'src-tauri', 'binaries');
// Construct the binary filename based on platform triple
let binaryName = `yt-dlp-${platformTriple}`;
if (platformTriple === 'x86_64-pc-windows-msvc') {
binaryName += '.exe';
}
// Full path to the binary
const binaryPath = path.join(binariesDir, binaryName);
// Check if binary exists
if (!fs.existsSync(binaryPath)) {
console.error(`Error: Binary not found at: ${binaryPath}`);
process.exit(1);
}
console.log(`Found binary at: ${binaryPath}`);
// Make binary executable if not on Windows
if (platformTriple !== 'x86_64-pc-windows-msvc') {
console.log('Making binary executable...');
fs.chmodSync(binaryPath, 0o755);
}
// Execute the update command
console.log(`Updating ${platformTriple} binary to latest nightly version...`);
execFile(binaryPath, ['--update-to', 'nightly'], (error, stdout, stderr) => {
if (error) {
console.error(`Error updating binary: ${error.message}`);
if (stderr) console.error(stderr);
process.exit(1);
}
console.log(`Update successful for ${platformTriple}:`);
console.log(stdout);
});

890
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "neodlp" name = "neodlp"
version = "0.4.1" version = "0.4.4"
description = "Cross-platform Video/Audio Downloader Desktop App based on YT-DLP with Modern UI and Browser Integration" description = "Cross-platform Video/Audio Downloader Desktop App based on YT-DLP with Modern UI and Browser Integration"
authors = ["neosubhamoy <hey@neosubhamoy.com>"] authors = ["neosubhamoy <hey@neosubhamoy.com>"]
edition = "2021" edition = "2021"

View File

@@ -31,7 +31,7 @@
"notification:default", "notification:default",
"log:default", "log:default",
{ {
"identifier": "opener:allow-open-path", "identifier": "fs:scope",
"allow": [ "allow": [
{ {
"path": "**" "path": "**"
@@ -39,7 +39,7 @@
] ]
}, },
{ {
"identifier": "fs:scope", "identifier": "opener:allow-open-path",
"allow": [ "allow": [
{ {
"path": "**" "path": "**"

View File

@@ -40,6 +40,11 @@
"args": true, "args": true,
"sidecar": true "sidecar": true
}, },
{
"name": "yt-dlp",
"cmd": "yt-dlp",
"args": true
},
{ {
"name": "ffmpeg", "name": "ffmpeg",
"cmd": "ffmpeg", "cmd": "ffmpeg",
@@ -66,9 +71,9 @@
"args": true "args": true
}, },
{ {
"name": "sh", "name": "sh",
"cmd": "sh", "cmd": "sh",
"args": true "args": true
} }
] ]
}, },
@@ -105,6 +110,11 @@
"args": true, "args": true,
"sidecar": true "sidecar": true
}, },
{
"name": "yt-dlp",
"cmd": "yt-dlp",
"args": true
},
{ {
"name": "ffmpeg", "name": "ffmpeg",
"cmd": "ffmpeg", "cmd": "ffmpeg",
@@ -119,6 +129,21 @@
"name": "deno", "name": "deno",
"cmd": "deno", "cmd": "deno",
"args": true "args": true
},
{
"name": "pkexec",
"cmd": "pkexec",
"args": true
},
{
"name": "powershell",
"cmd": "powershell",
"args": true
},
{
"name": "sh",
"cmd": "sh",
"args": true
} }
] ]
} }

View File

@@ -1,6 +1,6 @@
from __future__ import annotations from __future__ import annotations
__version__ = '1.2.2' __version__ = '0.8.1'
import abc import abc
import json import json
@@ -52,28 +52,32 @@ class BgUtilPTPBase(PoTokenProvider, abc.ABC):
def _get_attestation(self, webpage: str | None): def _get_attestation(self, webpage: str | None):
if not webpage: if not webpage:
return None return None
raw_challenge_data = self.ie._search_regex( raw_cd = (
r'''(?sx)window\.ytAtR\s*=\s*(?P<raw_cd>(?P<q>['"]) traverse_obj(
(?: self.ie._search_regex(
\\.| r'''(?sx)window\s*\.\s*ytAtN\s*\(\s*
(?!(?P=q)). (?P<js>\{.+?}\s*)
)* \s*\)\s*;''',
(?P=q))\s*;''', webpage,
webpage, 'ytAtN challenge',
'raw challenge data', default=None),
default=None, ({js_to_json}, {json.loads}, 'R'))
group='raw_cd', or traverse_obj(
) self.ie._search_regex(
att_txt = traverse_obj( r'''(?sx)window\.ytAtR\s*=\s*(?P<raw_cd>(?P<q>['"])
raw_challenge_data, (?:
({js_to_json}, {json.loads}, {json.loads}, 'bgChallenge') \\.|
) (?!(?P=q)).
if not att_txt: )*
self.logger.warning( (?P=q))\s*;''',
'Failed to extract initial attestation from the webpage' webpage,
) 'ytAtR challenge',
return None default=None),
return att_txt ({js_to_json}, {json.loads})))
if att_txt := traverse_obj(raw_cd, ({json.loads}, 'bgChallenge')):
return att_txt
self.logger.warning('Failed to extract initial attestation from the webpage')
return None
__all__ = ['__version__'] __all__ = ['__version__']

View File

@@ -31,6 +31,7 @@ use tokio::{
time::sleep, time::sleep,
}; };
use tokio_tungstenite::accept_async; use tokio_tungstenite::accept_async;
use log::{info, error};
struct ImageCache(StdMutex<HashMap<String, String>>); struct ImageCache(StdMutex<HashMap<String, String>>);
@@ -357,21 +358,48 @@ async fn open_file_with_app(
) -> Result<(), String> { ) -> Result<(), String> {
if let Some(name) = &app_name { if let Some(name) = &app_name {
if name == "explorer" { if name == "explorer" {
println!("Revealing file: {} in explorer", file_path); info!("Revealing file: {} in explorer", file_path);
return app_handle return app_handle
.opener() .opener()
.reveal_item_in_dir(file_path) .reveal_item_in_dir(file_path)
.map_err(|e| e.to_string()); .map_err(|e| {
error!("Failed to reveal file in explorer: {}", e);
e.to_string()
});
} }
println!("Opening file: {} with app: {}", file_path, name); info!("Opening file: {} with app: {}", file_path, name);
} else { } else {
println!("Opening file: {} with default app", file_path); info!("Opening file: {} with default app", file_path);
} }
app_handle app_handle
.opener() .opener()
.open_path(file_path, app_name) .open_path(file_path, app_name)
.map_err(|e| e.to_string()) .map_err(|e| {
error!("Failed to open file: {}", e);
e.to_string()
})
}
#[tauri::command]
async fn open_link_with_app(
app_handle: tauri::AppHandle,
url: String,
app_name: Option<String>,
) -> Result<(), String> {
if let Some(name) = &app_name {
info!("Opening link: {} with app: {}", url, name);
} else {
info!("Opening link: {} with default app", url);
}
app_handle
.opener()
.open_url(url, app_name)
.map_err(|e| {
error!("Failed to open link: {}", e);
e.to_string()
})
} }
#[tauri::command] #[tauri::command]
@@ -619,6 +647,7 @@ pub async fn run() {
kill_all_process, kill_all_process,
fetch_image, fetch_image,
open_file_with_app, open_file_with_app,
open_link_with_app,
list_ongoing_downloads, list_ongoing_downloads,
pause_ongoing_downloads, pause_ongoing_downloads,
send_to_extension, send_to_extension,

View File

@@ -2,7 +2,7 @@
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "NeoDLP", "productName": "NeoDLP",
"mainBinaryName": "neodlp", "mainBinaryName": "neodlp",
"version": "0.4.1", "version": "0.4.4",
"identifier": "com.neosubhamoy.neodlp", "identifier": "com.neosubhamoy.neodlp",
"build": { "build": {
"beforeDevCommand": "npm run dev", "beforeDevCommand": "npm run dev",

View File

@@ -39,7 +39,6 @@
], ],
"externalBin": [ "externalBin": [
"binaries/yt-dlp", "binaries/yt-dlp",
"binaries/aria2c",
"binaries/deno", "binaries/deno",
"binaries/neodlp-pot" "binaries/neodlp-pot"
], ],
@@ -48,7 +47,9 @@
}, },
"linux": { "linux": {
"deb": { "deb": {
"depends": ["ffmpeg"], "depends": ["ffmpeg", "aria2"],
"provides": ["yt-dlp", "deno"],
"conflicts": ["yt-dlp", "deno"],
"files": { "files": {
"/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
"/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
@@ -60,7 +61,9 @@
"rpm": { "rpm": {
"epoch": 0, "epoch": 0,
"release": "1", "release": "1",
"depends": ["ffmpeg"], "depends": ["ffmpeg", "aria2"],
"provides": ["yt-dlp", "deno"],
"conflicts": ["yt-dlp", "deno"],
"files": { "files": {
"/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
"/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",

View File

@@ -1,8 +1,8 @@
{ {
"identifier": "com.neosubhamoy.neodlp", "identifier": "com.neosubhamoy.neodlp",
"build": { "build": {
"beforeDevCommand": "cargo build --manifest-path=./src-tauri/msghost/Cargo.toml && npm run dev", "beforeDevCommand": "npm run dev",
"beforeBuildCommand": "cargo build --release --manifest-path=./src-tauri/msghost/Cargo.toml && npm run build", "beforeBuildCommand": "npm run build",
"devUrl": "http://localhost:1420", "devUrl": "http://localhost:1420",
"frontendDist": "../dist" "frontendDist": "../dist"
}, },
@@ -38,9 +38,6 @@
], ],
"externalBin": [ "externalBin": [
"binaries/yt-dlp", "binaries/yt-dlp",
"binaries/ffmpeg",
"binaries/ffprobe",
"binaries/aria2c",
"binaries/deno", "binaries/deno",
"binaries/neodlp-pot" "binaries/neodlp-pot"
], ],

View File

@@ -39,7 +39,6 @@
], ],
"externalBin": [ "externalBin": [
"binaries/yt-dlp", "binaries/yt-dlp",
"binaries/aria2c",
"binaries/deno", "binaries/deno",
"binaries/neodlp-pot" "binaries/neodlp-pot"
], ],
@@ -48,7 +47,9 @@
}, },
"linux": { "linux": {
"deb": { "deb": {
"depends": ["ffmpeg"], "depends": ["ffmpeg", "aria2"],
"provides": ["yt-dlp", "deno"],
"conflicts": ["yt-dlp", "deno"],
"files": { "files": {
"/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
"/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
@@ -60,7 +61,9 @@
"rpm": { "rpm": {
"epoch": 0, "epoch": 0,
"release": "1", "release": "1",
"depends": ["ffmpeg"], "depends": ["ffmpeg", "aria2"],
"provides": ["yt-dlp", "deno"],
"conflicts": ["yt-dlp", "deno"],
"files": { "files": {
"/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/opt/chrome/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
"/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json", "/etc/chromium/native-messaging-hosts/com.neosubhamoy.neodlp.json": "./resources/msghost-manifest/linux/chrome.json",
@@ -72,7 +75,8 @@
"appimage": { "appimage": {
"files": { "files": {
"/usr/bin/ffmpeg": "./binaries/ffmpeg-x86_64-unknown-linux-gnu", "/usr/bin/ffmpeg": "./binaries/ffmpeg-x86_64-unknown-linux-gnu",
"/usr/bin/ffprobe": "./binaries/ffprobe-x86_64-unknown-linux-gnu" "/usr/bin/ffprobe": "./binaries/ffprobe-x86_64-unknown-linux-gnu",
"/usr/bin/aria2c": "./binaries/aria2c-x86_64-unknown-linux-gnu"
} }
} }
} }

View File

@@ -3,15 +3,15 @@ import { TooltipProvider } from "@/components/ui/tooltip";
import { AppContext } from "@/providers/appContextProvider"; import { AppContext } from "@/providers/appContextProvider";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { arch, exeExtension } from "@tauri-apps/plugin-os"; import { arch, exeExtension } from "@tauri-apps/plugin-os";
import { downloadDir, join, resourceDir, tempDir } from "@tauri-apps/api/path"; import { downloadDir, join, resourceDir, tempDir, dataDir } from "@tauri-apps/api/path";
import { useBasePathsStore, useCurrentVideoMetadataStore, useDownloaderPageStatesStore, useDownloadStatesStore, useKvPairsStatesStore, useSettingsPageStatesStore } from "@/services/store"; import { useBasePathsStore, useCurrentVideoMetadataStore, useDownloaderPageStatesStore, useDownloadStatesStore, useEnvironmentStore, useKvPairsStatesStore, useSettingsPageStatesStore } from "@/services/store";
import { isObjEmpty} from "@/utils"; import { isObjEmpty} from "@/utils";
import { Command } from "@tauri-apps/plugin-shell"; import { Command } from "@tauri-apps/plugin-shell";
import { useUpdateDownloadStatus } from "@/services/mutations"; import { useUpdateDownloadStatus } from "@/services/mutations";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { useFetchAllDownloadStates, useFetchAllkVPairs, useFetchAllSettings } from "@/services/queries"; import { useFetchAllDownloadStates, useFetchAllkVPairs, useFetchAllSettings } from "@/services/queries";
import { config } from "@/config"; import { config } from "@/config";
import * as fs from "@tauri-apps/plugin-fs"; // import * as fs from "@tauri-apps/plugin-fs";
import { useYtDlpUpdater } from "@/helpers/use-ytdlp-updater"; import { useYtDlpUpdater } from "@/helpers/use-ytdlp-updater";
import { getVersion } from "@tauri-apps/api/app"; import { getVersion } from "@tauri-apps/api/app";
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow"; import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
@@ -40,6 +40,10 @@ export default function App({ children }: { children: React.ReactNode }) {
const setDownloadStates = useDownloadStatesStore((state) => state.setDownloadStates); const setDownloadStates = useDownloadStatesStore((state) => state.setDownloadStates);
const setPath = useBasePathsStore((state) => state.setPath); const setPath = useBasePathsStore((state) => state.setPath);
const setIsFlatpak = useEnvironmentStore((state) => state.setIsFlatpak);
const setIsAppimage = useEnvironmentStore((state) => state.setIsAppimage);
const setAppDirPath = useEnvironmentStore((state) => state.setAppDirPath);
const setIsUsingDefaultSettings = useSettingsPageStatesStore((state) => state.setIsUsingDefaultSettings); const setIsUsingDefaultSettings = useSettingsPageStatesStore((state) => state.setIsUsingDefaultSettings);
const setSettingsKey = useSettingsPageStatesStore((state) => state.setSettingsKey); const setSettingsKey = useSettingsPageStatesStore((state) => state.setSettingsKey);
const appVersion = useSettingsPageStatesStore(state => state.appVersion); const appVersion = useSettingsPageStatesStore(state => state.appVersion);
@@ -122,6 +126,26 @@ export default function App({ children }: { children: React.ReactNode }) {
}; };
}, [stopPotServer]); }, [stopPotServer]);
// Detect sandbox environments
useEffect(() => {
const detectEnvironment = async () => {
try {
const isFlatpak = await invoke<boolean>('is_flatpak');
const appimagePath = await invoke<string | null>('get_appimage_path');
console.log('Environment detection results:', { isFlatpak, appimagePath });
if (isFlatpak) setIsFlatpak(true);
if (appimagePath) {
setIsAppimage(true);
setAppDirPath(appimagePath);
}
} catch (e) {
console.error('Failed to detect environment:', e);
}
}
detectEnvironment();
}, [setIsFlatpak, setIsAppimage, setAppDirPath]);
// Listen for websocket messages // Listen for websocket messages
useEffect(() => { useEffect(() => {
const unlisten = listen<WebSocketMessage>('websocket-message', (event) => { const unlisten = listen<WebSocketMessage>('websocket-message', (event) => {
@@ -193,21 +217,18 @@ export default function App({ children }: { children: React.ReactNode }) {
const tempDownloadDirPath = isFlatpak ? await join(downloadDirPath, config.appName, '.tempdownloads') : await join(tempDirPath, config.appPkgName, 'downloads'); const tempDownloadDirPath = isFlatpak ? await join(downloadDirPath, config.appName, '.tempdownloads') : await join(tempDirPath, config.appPkgName, 'downloads');
const appDownloadDirPath = await join(downloadDirPath, config.appName); const appDownloadDirPath = await join(downloadDirPath, config.appName);
LOG.info('NEODLP', `Resolved paths: isFlatpak: ${isFlatpak}, downloadDir: ${downloadDirPath}, tempDir: ${tempDirPath}, tempDownloadDir: ${tempDownloadDirPath}, appDownloadDir: ${appDownloadDirPath}`); // if (!await fs.exists(tempDownloadDirPath)) fs.mkdir(tempDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${tempDownloadDirPath}`) });
if (!await fs.exists(tempDownloadDirPath)) fs.mkdir(tempDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${tempDownloadDirPath}`) });
setPath('ffmpegPath', ffmpegPath); setPath('ffmpegPath', ffmpegPath);
setPath('tempDownloadDirPath', tempDownloadDirPath); setPath('tempDownloadDirPath', tempDownloadDirPath);
if (DOWNLOAD_DIR) { if (DOWNLOAD_DIR) {
setPath('downloadDirPath', DOWNLOAD_DIR); setPath('downloadDirPath', DOWNLOAD_DIR);
} else { } else {
if(!await fs.exists(appDownloadDirPath)) fs.mkdir(appDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${appDownloadDirPath}`) }); // if(!await fs.exists(appDownloadDirPath)) fs.mkdir(appDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${appDownloadDirPath}`) });
setPath('downloadDirPath', appDownloadDirPath); setPath('downloadDirPath', appDownloadDirPath);
} }
console.log('Paths initialized:', { ffmpegPath, tempDownloadDirPath, downloadDirPath: DOWNLOAD_DIR || appDownloadDirPath }); console.log('Paths initialized:', { ffmpegPath, tempDownloadDirPath, downloadDirPath: DOWNLOAD_DIR || appDownloadDirPath });
} catch (e) { } catch (e) {
LOG.error('NEODLP', `Failed to fetch paths: ${e}`);
console.error('Failed to fetch paths:', e); console.error('Failed to fetch paths:', e);
} }
}; };
@@ -236,7 +257,11 @@ export default function App({ children }: { children: React.ReactNode }) {
const fetchYtDlpVersion = async () => { const fetchYtDlpVersion = async () => {
setIsFetchingYtDlpVersion(true); setIsFetchingYtDlpVersion(true);
try { try {
const command = Command.sidecar('binaries/yt-dlp', ['--version']); const isFlatpak = await invoke<boolean>('is_flatpak');
const xdgDataDir = await dataDir();
const command = isFlatpak
? Command.create('sh', ['-c', `${xdgDataDir}/yt-dlp/yt-dlp --version`])
: Command.sidecar('binaries/yt-dlp', ['--version']);
const output = await command.execute(); const output = await command.execute();
if (output.code === 0) { if (output.code === 0) {
const version = output.stdout.trim(); const version = output.stdout.trim();
@@ -286,10 +311,14 @@ export default function App({ children }: { children: React.ReactNode }) {
return; return;
} }
const isFlatpak = await invoke<boolean>('is_flatpak'); const isFlatpak = await invoke<boolean>('is_flatpak');
if (isFlatpak) { if (isFlatpak && (!linuxRegisteredVersion || linuxRegisteredVersion !== appVersion)) {
console.log("Flatpak detected! Skipping yt-dlp auto-update"); console.log("Flatpak registration not completed yet! Skipping yt-dlp auto-update...");
return; return;
} }
// if (isFlatpak) {
// console.log("Flatpak detected! Skipping yt-dlp auto-update");
// return;
// }
hasRunYtDlpAutoUpdateRef.current = true; hasRunYtDlpAutoUpdateRef.current = true;
console.log("Checking yt-dlp auto-update with loaded config values:", { console.log("Checking yt-dlp auto-update with loaded config values:", {
autoUpdate: YTDLP_AUTO_UPDATE, autoUpdate: YTDLP_AUTO_UPDATE,

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -4,7 +4,7 @@ import { AspectRatio } from "@/components/ui/aspect-ratio";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator"; import { Separator } from "@/components/ui/separator";
import { toast } from "sonner"; import { toast } from "sonner";
import { useCurrentVideoMetadataStore, useDownloadActionStatesStore, useLibraryPageStatesStore } from "@/services/store"; import { useCurrentVideoMetadataStore, useDownloadActionStatesStore, useEnvironmentStore, useLibraryPageStatesStore } from "@/services/store";
import { formatBitrate, formatCodec, formatDurationString, formatFileSize, paginate } from "@/utils"; import { formatBitrate, formatCodec, formatDurationString, formatFileSize, paginate } from "@/utils";
import { ArrowUpRightIcon, AudioLines, CircleArrowDown, Clock, File, FileAudio2, FileQuestion, FileVideo2, FolderInput, ListVideo, Music, Play, Search, Trash2, Video } from "lucide-react"; import { ArrowUpRightIcon, AudioLines, CircleArrowDown, Clock, File, FileAudio2, FileQuestion, FileVideo2, FolderInput, ListVideo, Music, Play, Search, Trash2, Video } from "lucide-react";
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
@@ -33,6 +33,8 @@ export function CompletedDownload({ state }: CompletedDownloadProps) {
const downloadActions = useDownloadActionStatesStore(state => state.downloadActions); const downloadActions = useDownloadActionStatesStore(state => state.downloadActions);
const setIsDeleteFileChecked = useDownloadActionStatesStore(state => state.setIsDeleteFileChecked); const setIsDeleteFileChecked = useDownloadActionStatesStore(state => state.setIsDeleteFileChecked);
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const downloadStateDeleter = useDeleteDownloadState(); const downloadStateDeleter = useDeleteDownloadState();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -276,10 +278,12 @@ export function CompletedDownload({ state }: CompletedDownloadProps) {
<Play className="w-4 h-4" /> <Play className="w-4 h-4" />
Open Open
</Button> </Button>
<Button size="sm" variant="outline" onClick={() => openFile(state.filepath, 'explorer')}> {!isFlatpak && (
<FolderInput className="w-4 h-4" /> <Button size="sm" variant="outline" onClick={() => openFile(state.filepath, 'explorer')}>
Reveal <FolderInput className="w-4 h-4" />
</Button> Reveal
</Button>
)}
<Button size="sm" variant="outline" onClick={() => handleSearch(state.url, state.playlist_id ? true : false)}> <Button size="sm" variant="outline" onClick={() => handleSearch(state.url, state.playlist_id ? true : false)}>
<Search className="w-4 h-4" /> <Search className="w-4 h-4" />
Search Search

View File

@@ -1,13 +1,13 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { useBasePathsStore, useDownloaderPageStatesStore, useDownloadStatesStore, useSettingsPageStatesStore } from "@/services/store"; import { useBasePathsStore, useDownloaderPageStatesStore, useDownloadStatesStore, useEnvironmentStore, useSettingsPageStatesStore } from "@/services/store";
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Switch } from "@/components/ui/switch"; import { Switch } from "@/components/ui/switch";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { toast } from "sonner"; import { toast } from "sonner";
import { BadgeCheck, BellRing, BrushCleaning, Bug, Cookie, ExternalLink, FilePen, FileVideo, Folder, FolderOpen, Github, Globe, Heart, Info, KeyRound, Loader2, LucideIcon, Mail, Monitor, Moon, Package, Scale, ShieldMinus, SquareTerminal, Sun, Terminal, Timer, Trash, TriangleAlert, WandSparkles, Wifi, Wrench } from "lucide-react"; import { BadgeCheck, BellRing, BrushCleaning, Bug, CircleCheck, Cookie, ExternalLink, FilePen, FileVideo, Folder, FolderOpen, Github, Globe, Heart, Info, KeyRound, Loader2, LucideIcon, Mail, Monitor, Moon, Package, Scale, ShieldMinus, SquareTerminal, Sun, Terminal, Timer, Trash, TriangleAlert, WandSparkles, Wifi, Wrench } from "lucide-react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { Slider } from "@/components/ui/slider"; import { Slider } from "@/components/ui/slider";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
@@ -282,9 +282,11 @@ function AppAppearanceSettings() {
); );
} }
function AppFolderSettings() { function AppFilesystemSettings() {
const { saveSettingsKey } = useSettings(); const { saveSettingsKey } = useSettings();
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);
@@ -293,6 +295,8 @@ function AppFolderSettings() {
const setPath = useBasePathsStore((state) => state.setPath); const setPath = useBasePathsStore((state) => state.setPath);
const filenameTemplate = useSettingsPageStatesStore(state => state.settings.filename_template); const filenameTemplate = useSettingsPageStatesStore(state => state.settings.filename_template);
const windowsFilenames = useSettingsPageStatesStore(state => state.settings.windows_filenames);
const restrictFilenames = useSettingsPageStatesStore(state => state.settings.restrict_filenames);
const downloadStates = useDownloadStatesStore(state => state.downloadStates); const downloadStates = useDownloadStatesStore(state => state.downloadStates);
const ongoingDownloads = downloadStates.filter(state => const ongoingDownloads = downloadStates.filter(state =>
@@ -364,6 +368,7 @@ function AppFolderSettings() {
<Input className="focus-visible:ring-0" type="text" placeholder="Select download directory" value={downloadDirPath ?? 'Unknown'} readOnly/> <Input className="focus-visible:ring-0" type="text" placeholder="Select download directory" value={downloadDirPath ?? 'Unknown'} readOnly/>
<Button <Button
variant="outline" variant="outline"
disabled={isFlatpak}
onClick={async () => { onClick={async () => {
try { try {
const folder = await open({ const folder = await open({
@@ -395,7 +400,7 @@ function AppFolderSettings() {
<AlertDialogTrigger asChild> <AlertDialogTrigger asChild>
<Button <Button
variant="destructive" variant="destructive"
disabled={ongoingDownloads.length > 0} disabled={ongoingDownloads.length > 0 || isFlatpak}
> >
<BrushCleaning className="size-4" /> Clean <BrushCleaning className="size-4" /> Clean
</Button> </Button>
@@ -445,6 +450,26 @@ function AppFolderSettings() {
</form> </form>
</Form> </Form>
</div> </div>
<div className="sanitize-filenames">
<h3 className="font-semibold">Sanitize Filenames</h3>
<p className="text-xs text-muted-foreground mb-3">Make filenames windows-compatible, allow only ASCII characters and replace spaces with underscore (recommended, disabling it may cause issue with some downloads, also it may cause paused downloads to re-start from begining)</p>
<div className="flex items-center space-x-2 mb-3">
<Switch
id="windows-filenames"
checked={windowsFilenames}
onCheckedChange={(checked) => saveSettingsKey('windows_filenames', checked)}
/>
<Label htmlFor="windows-filenames">Windows Compatibility</Label>
</div>
<div className="flex items-center space-x-2">
<Switch
id="restrict-filenames"
checked={restrictFilenames}
onCheckedChange={(checked) => saveSettingsKey('restrict_filenames', checked)}
/>
<Label htmlFor="restrict-filenames">Force ASCII Only</Label>
</div>
</div>
</> </>
); );
} }
@@ -782,6 +807,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);
@@ -798,7 +825,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>
@@ -807,7 +834,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" />
@@ -823,7 +850,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" />
@@ -850,7 +877,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({
@@ -1249,6 +1276,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);
@@ -1320,7 +1349,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>
@@ -1346,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} disabled={useCustomCommands || !usePotoken /*|| isFlatpak*/}
/> />
</div> </div>
</div> </div>
@@ -1359,7 +1388,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>
@@ -1378,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} disabled={!watchedPotServerPort || Number(watchedPotServerPort) === potServerPort || Object.keys(potServerPortFormErrors).length > 0 || !usePotoken || useCustomCommands || isChangingPotServerPort || isStartingPotServer /*|| isFlatpak*/}
> >
{isChangingPotServerPort ? ( {isChangingPotServerPort ? (
<> <>
@@ -1400,6 +1429,8 @@ function AppPoTokenSettings() {
function AppNotificationSettings() { function AppNotificationSettings() {
const { saveSettingsKey } = useSettings(); const { saveSettingsKey } = useSettings();
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
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 downloadCompletionNotification = useSettingsPageStatesStore(state => state.settings.download_completion_notification); const downloadCompletionNotification = useSettingsPageStatesStore(state => state.settings.download_completion_notification);
@@ -1413,6 +1444,7 @@ function AppNotificationSettings() {
<Switch <Switch
id="enable-notifications" id="enable-notifications"
checked={enableNotifications} checked={enableNotifications}
disabled={isFlatpak}
onCheckedChange={async (checked) => { onCheckedChange={async (checked) => {
if (checked) { if (checked) {
const granted = await isPermissionGranted(); const granted = await isPermissionGranted();
@@ -1438,7 +1470,7 @@ function AppNotificationSettings() {
id="update-notification" id="update-notification"
checked={updateNotification} checked={updateNotification}
onCheckedChange={(checked) => saveSettingsKey('update_notification', checked)} onCheckedChange={(checked) => saveSettingsKey('update_notification', checked)}
disabled={!enableNotifications} disabled={!enableNotifications || isFlatpak}
/> />
<Label htmlFor="update-notification">App Updates</Label> <Label htmlFor="update-notification">App Updates</Label>
</div> </div>
@@ -1447,7 +1479,7 @@ function AppNotificationSettings() {
id="download-completion-notification" id="download-completion-notification"
checked={downloadCompletionNotification} checked={downloadCompletionNotification}
onCheckedChange={(checked) => saveSettingsKey('download_completion_notification', checked)} onCheckedChange={(checked) => saveSettingsKey('download_completion_notification', checked)}
disabled={!enableNotifications} disabled={!enableNotifications || isFlatpak}
/> />
<Label htmlFor="download-completion-notification">Download Completion</Label> <Label htmlFor="download-completion-notification">Download Completion</Label>
</div> </div>
@@ -1686,6 +1718,9 @@ function AppDebugSettings() {
} }
function AppInfoSettings() { function AppInfoSettings() {
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
const isAppimage = useEnvironmentStore(state => state.isAppimage);
const appVersion = useSettingsPageStatesStore(state => state.appVersion); const appVersion = useSettingsPageStatesStore(state => state.appVersion);
const binDepsList = [ const binDepsList = [
@@ -1799,6 +1834,35 @@ function AppInfoSettings() {
</Button> </Button>
</Card> </Card>
</div> </div>
<div className="healthcheck">
<h3 className="font-semibold">Health Check</h3>
<p className="text-xs text-muted-foreground mb-3">Ensure everything is working fine</p>
{isFlatpak ? (
<Alert className="">
<TriangleAlert className="size-4 stroke-primary" />
<AlertTitle className="text-sm">Flatpak Sandbox Detected!</AlertTitle>
<AlertDescription className="text-xs">
It looks like you are running NeoDLP in a Flatpak sandbox. Some features like browser integration, desktop notifications, cookies, changing download folder, revealing completed downloads in explorer, 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>
</Alert>
) : isAppimage ? (
<Alert className="">
<TriangleAlert className="size-4 stroke-primary" />
<AlertTitle className="text-sm">Appimage Environment Detected!</AlertTitle>
<AlertDescription className="text-xs">
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.
</AlertDescription>
</Alert>
) : (
<Alert className="">
<CircleCheck className="size-4 stroke-primary" />
<AlertTitle className="text-sm">All Set! Cheers :)</AlertTitle>
<AlertDescription className="text-xs">
NeoDLP is running as normal without any limitations! You should be able to use all the features of NeoDLP without any issues. If you face any problem, feel free to report it to us.
</AlertDescription>
</Alert>
)}
</div>
<div className="bug-report"> <div className="bug-report">
<h3 className="font-semibold">Bug Report</h3> <h3 className="font-semibold">Bug Report</h3>
<p className="text-xs text-muted-foreground mb-3">Noticed any bug or inconsistencies? Report it to help us improve</p> <p className="text-xs text-muted-foreground mb-3">Noticed any bug or inconsistencies? Report it to help us improve</p>
@@ -1869,6 +1933,8 @@ function AppInfoSettings() {
} }
export function ApplicationSettings() { export function ApplicationSettings() {
// const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
const activeSubAppTab = useSettingsPageStatesStore(state => state.activeSubAppTab); const activeSubAppTab = useSettingsPageStatesStore(state => state.activeSubAppTab);
const setActiveSubAppTab = useSettingsPageStatesStore(state => state.setActiveSubAppTab); const setActiveSubAppTab = useSettingsPageStatesStore(state => state.setActiveSubAppTab);
@@ -1889,7 +1955,7 @@ export function ApplicationSettings() {
const tabsList = [ const tabsList = [
{ key: 'general', label: 'General', icon: Wrench, component: <AppGeneralSettings /> }, { key: 'general', label: 'General', icon: Wrench, component: <AppGeneralSettings /> },
{ key: 'appearance', label: 'Appearance', icon: WandSparkles, component: <AppAppearanceSettings /> }, { key: 'appearance', label: 'Appearance', icon: WandSparkles, component: <AppAppearanceSettings /> },
{ key: 'folders', label: 'Folders', icon: Folder, component: <AppFolderSettings /> }, { key: 'filesystem', label: 'Filesystem', icon: Folder, component: <AppFilesystemSettings /> },
{ key: 'formats', label: 'Formats', icon: FileVideo, component: <AppFormatSettings /> }, { key: 'formats', label: 'Formats', icon: FileVideo, component: <AppFormatSettings /> },
{ key: 'embedding', label: 'Embedding', icon: FilePen, component: <AppEmbeddingSettings /> }, { key: 'embedding', label: 'Embedding', icon: FilePen, component: <AppEmbeddingSettings /> },
{ key: 'network', label: 'Network', icon: Wifi, component: <AppNetworkSettings /> }, { key: 'network', label: 'Network', icon: Wifi, component: <AppNetworkSettings /> },
@@ -1926,12 +1992,14 @@ export function ApplicationSettings() {
<Switch <Switch
id="ytdlp-auto-update" id="ytdlp-auto-update"
checked={ytDlpAutoUpdate} checked={ytDlpAutoUpdate}
// disabled={isFlatpak}
onCheckedChange={(checked) => saveSettingsKey('ytdlp_auto_update', checked)} onCheckedChange={(checked) => saveSettingsKey('ytdlp_auto_update', checked)}
/> />
<Label htmlFor="ytdlp-auto-update">Auto Update</Label> <Label htmlFor="ytdlp-auto-update">Auto Update</Label>
</div> </div>
<Select <Select
value={ytDlpUpdateChannel} value={ytDlpUpdateChannel}
// disabled={isFlatpak}
onValueChange={(value) => saveSettingsKey('ytdlp_update_channel', value)} onValueChange={(value) => saveSettingsKey('ytdlp_update_channel', value)}
> >
<SelectTrigger className="w-37.5 ring-0 focus:ring-0"> <SelectTrigger className="w-37.5 ring-0 focus:ring-0">
@@ -1946,7 +2014,7 @@ export function ApplicationSettings() {
</SelectContent> </SelectContent>
</Select> </Select>
<Button <Button
disabled={ytDlpAutoUpdate || isUpdatingYtDlp || ongoingDownloads.length > 0} disabled={ytDlpAutoUpdate || isUpdatingYtDlp || ongoingDownloads.length > 0 /*|| isFlatpak*/}
onClick={async () => await updateYtDlp()} onClick={async () => await updateYtDlp()}
> >
{isUpdatingYtDlp ? ( {isUpdatingYtDlp ? (

View File

@@ -1,7 +1,7 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { useSettingsPageStatesStore } from "@/services/store"; import { useEnvironmentStore, useSettingsPageStatesStore } from "@/services/store";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { toast } from "sonner"; import { toast } from "sonner";
@@ -15,6 +15,7 @@ import { invoke } from "@tauri-apps/api/core";
import { SlidingButton } from "@/components/custom/slidingButton"; import { SlidingButton } from "@/components/custom/slidingButton";
import clsx from "clsx"; import clsx from "clsx";
import { NumberInput } from "@/components/custom/numberInput"; import { NumberInput } from "@/components/custom/numberInput";
import { platform } from "@tauri-apps/plugin-os";
const websocketPortSchema = z.object({ const websocketPortSchema = z.object({
port: z.coerce.number<number>({ port: z.coerce.number<number>({
@@ -31,9 +32,12 @@ const websocketPortSchema = z.object({
}); });
function ExtInstallSettings() { function ExtInstallSettings() {
const currentPlatform = platform();
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
const openLink = async (url: string, app: string | null) => { const openLink = async (url: string, app: string | null) => {
try { try {
await invoke('open_file_with_app', { filePath: url, appName: app }).then(() => { await invoke('open_link_with_app', { url: url, appName: app }).then(() => {
toast.info("Opening link", { toast.info("Opening link", {
description: `Opening link with ${app ? app : 'default app'}.`, description: `Opening link with ${app ? app : 'default app'}.`,
}) })
@@ -58,7 +62,7 @@ function ExtInstallSettings() {
<span>Get Now</span> <span>Get Now</span>
</div> </div>
} }
onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', 'chrome')} onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', isFlatpak ? null : currentPlatform === "linux" ? 'google-chrome' : 'chrome')}
> >
<span className="font-semibold flex items-center gap-2"> <span className="font-semibold flex items-center gap-2">
<svg className="size-4 fill-primary-foreground" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> <svg className="size-4 fill-primary-foreground" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
@@ -75,7 +79,7 @@ function ExtInstallSettings() {
<span>Get Now</span> <span>Get Now</span>
</div> </div>
} }
onClick={() => openLink('https://addons.mozilla.org/en-US/firefox/addon/neo-downloader-plus', 'firefox')} onClick={() => openLink('https://addons.mozilla.org/en-US/firefox/addon/neo-downloader-plus', isFlatpak ? null : 'firefox')}
> >
<span className="font-semibold flex items-center gap-2"> <span className="font-semibold flex items-center gap-2">
<svg className="size-4 fill-primary-foreground" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> <svg className="size-4 fill-primary-foreground" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
@@ -87,11 +91,11 @@ function ExtInstallSettings() {
</SlidingButton> </SlidingButton>
</div> </div>
<div className="flex gap-2 mb-4"> <div className="flex gap-2 mb-4">
<Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', 'msedge')}>Edge</Button> <Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', isFlatpak ? null : 'msedge')}>Edge</Button>
<Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', 'opera')}>Opera</Button> <Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', isFlatpak ? null : 'opera')}>Opera</Button>
<Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', 'brave')}>Brave</Button> <Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', isFlatpak ? null : 'brave')}>Brave</Button>
<Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', 'vivaldi')}>Vivaldi</Button> <Button variant="outline" onClick={() => openLink('https://chromewebstore.google.com/detail/neo-downloader-plus/mehopeailfjmiloiiohgicphlcgpompf', isFlatpak ? null : 'vivaldi')}>Vivaldi</Button>
<Button variant="outline" onClick={() => openLink('https://addons.mozilla.org/en-US/firefox/addon/neo-downloader-plus', 'zen')}>Zen</Button> <Button variant="outline" onClick={() => openLink('https://addons.mozilla.org/en-US/firefox/addon/neo-downloader-plus', isFlatpak ? null : 'zen')}>Zen</Button>
</div> </div>
<p className="text-xs text-muted-foreground mb-2">* These links opens with coresponding browsers only. Make sure the browser is installed before clicking the link</p> <p className="text-xs text-muted-foreground mb-2">* These links opens with coresponding browsers only. Make sure the browser is installed before clicking the link</p>
</div> </div>

View File

@@ -46,7 +46,7 @@ export function AppSidebar() {
]; ];
useEffect(() => { useEffect(() => {
let timeout: NodeJS.Timeout; let timeout: ReturnType<typeof setTimeout>;
if (open) { if (open) {
timeout = setTimeout(() => { timeout = setTimeout(() => {
setShowBadge(true); setShowBadge(true);

View File

@@ -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;

View File

@@ -15,6 +15,7 @@ import { sendNotification } from '@tauri-apps/plugin-notification';
import { FetchVideoMetadataParams, StartDownloadParams } from "@/providers/appContextProvider"; import { FetchVideoMetadataParams, StartDownloadParams } from "@/providers/appContextProvider";
import { useDebouncedCallback } from '@tanstack/react-pacer/debouncer'; import { useDebouncedCallback } from '@tanstack/react-pacer/debouncer';
import { fetchDownloadStateById } from "@/services/database"; import { fetchDownloadStateById } from "@/services/database";
import { dataDir } from "@tauri-apps/api/path";
export default function useDownloader() { export default function useDownloader() {
const globalDownloadStates = useDownloadStatesStore((state) => state.downloadStates); const globalDownloadStates = useDownloadStatesStore((state) => state.downloadStates);
@@ -72,6 +73,8 @@ export default function useDownloader() {
use_potoken: USE_POTOKEN, use_potoken: USE_POTOKEN,
disable_innertube: DISABLE_INNERTUBE, disable_innertube: DISABLE_INNERTUBE,
pot_server_port: POT_SERVER_PORT, pot_server_port: POT_SERVER_PORT,
windows_filenames: WINDOWS_FILENAMES,
restrict_filenames: RESTRICT_FILENAMES
} = useSettingsPageStatesStore(state => state.settings); } = useSettingsPageStatesStore(state => state.settings);
const isRunningPotServer = useSettingsPageStatesStore(state => state.isRunningPotServer); const isRunningPotServer = useSettingsPageStatesStore(state => state.isRunningPotServer);
@@ -196,7 +199,11 @@ export default function useDownloader() {
} }
} }
const command = Command.sidecar('binaries/yt-dlp', args); const isFlatpak = await invoke<boolean>('is_flatpak');
const xdgDataDir = await dataDir();
const command = isFlatpak
? Command.create('sh', ['-c', `${xdgDataDir}/yt-dlp/yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`])
: Command.sidecar('binaries/yt-dlp', args);
let jsonOutput = ''; let jsonOutput = '';
@@ -329,8 +336,6 @@ export default function useDownloader() {
`temp:${tempDownloadDirPath}`, `temp:${tempDownloadDirPath}`,
'--paths', '--paths',
`home:${downloadDirPath}`, `home:${downloadDirPath}`,
'--windows-filenames',
'--restrict-filenames',
'--exec', '--exec',
'after_move:echo Finalpath: {}', 'after_move:echo Finalpath: {}',
'--no-mtime', '--no-mtime',
@@ -348,6 +353,14 @@ export default function useDownloader() {
args.push('--output', `${FILENAME_TEMPLATE}[${downloadId}].%(ext)s`); args.push('--output', `${FILENAME_TEMPLATE}[${downloadId}].%(ext)s`);
} }
if (WINDOWS_FILENAMES) {
args.push('--windows-filenames');
}
if (RESTRICT_FILENAMES) {
args.push('--restrict-filenames');
}
if ((!USE_CUSTOM_COMMANDS && !resumeState?.custom_command) && USE_DELAY) { if ((!USE_CUSTOM_COMMANDS && !resumeState?.custom_command) && USE_DELAY) {
if (!DELAY_PLAYLIST_ONLY) { if (!DELAY_PLAYLIST_ONLY) {
if (DELAY_MODE === 'auto') { if (DELAY_MODE === 'auto') {
@@ -557,7 +570,11 @@ export default function useDownloader() {
} }
console.log('Starting download with args:', args); console.log('Starting download with args:', args);
const command = Command.sidecar('binaries/yt-dlp', args); const isFlatpak = await invoke<boolean>('is_flatpak');
const xdgDataDir = await dataDir();
const command = isFlatpak
? Command.create('sh', ['-c', `${xdgDataDir}/yt-dlp/yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`])
: Command.sidecar('binaries/yt-dlp', args);
command.on('close', async (data) => { command.on('close', async (data) => {
if (data.code !== 0) { if (data.code !== 0) {

View File

@@ -4,6 +4,7 @@ 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";
import { useYtDlpUpdater } from "@/helpers/use-ytdlp-updater";
interface FileMap { interface FileMap {
source: string; source: string;
@@ -14,6 +15,7 @@ interface FileMap {
export function useLinuxRegisterer() { export function useLinuxRegisterer() {
const { saveKvPair } = useKvPairs(); const { saveKvPair } = useKvPairs();
const { updateYtDlp } = useYtDlpUpdater();
const appVersion = useSettingsPageStatesStore(state => state.appVersion); const appVersion = useSettingsPageStatesStore(state => state.appVersion);
const registerToLinux = async () => { const registerToLinux = async () => {
@@ -21,20 +23,20 @@ export function useLinuxRegisterer() {
const isFlatpak = await invoke<boolean>('is_flatpak'); const isFlatpak = await invoke<boolean>('is_flatpak');
const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir(); const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir();
const homeDirPath = await homeDir(); const homeDirPath = await homeDir();
const flatpakChromeManifestContent = { // const flatpakChromeManifestContent = {
name: "com.neosubhamoy.neodlp", // name: "com.neosubhamoy.neodlp",
description: "NeoDLP MsgHost", // description: "NeoDLP MsgHost",
path: `${homeDirPath}/.local/bin/neodlp-msghost`, // path: `${homeDirPath}/.local/bin/neodlp-msghost`,
type: "stdio", // type: "stdio",
allowed_origins: ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"] // allowed_origins: ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"]
}; // };
const flatpakFirefoxManifestContent = { // const flatpakFirefoxManifestContent = {
name: "com.neosubhamoy.neodlp", // name: "com.neosubhamoy.neodlp",
description: "NeoDLP MsgHost", // description: "NeoDLP MsgHost",
path: `${homeDirPath}/.local/bin/neodlp-msghost`, // path: `${homeDirPath}/.local/bin/neodlp-msghost`,
type: "stdio", // type: "stdio",
allowed_extensions: ["neodlp@neosubhamoy.com"] // allowed_extensions: ["neodlp@neosubhamoy.com"]
}; // };
const filesToCopy: FileMap[] = [ 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/' }, { 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/' },
@@ -43,18 +45,27 @@ export function useLinuxRegisterer() {
]; ];
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', destination: '.var/app/com.neosubhamoy.neodlp/data/yt-dlp/yt-dlp', dir: '.var/app/com.neosubhamoy.neodlp/data/yt-dlp/' },
{ 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_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
// 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 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', `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) {
@@ -94,6 +105,11 @@ export function useLinuxRegisterer() {
} }
} }
saveKvPair('linux_registered_version', appVersion); saveKvPair('linux_registered_version', appVersion);
if (isFlatpak) {
await updateYtDlp();
}
return { success: true, message: 'Registered successfully' } return { success: true, message: 'Registered successfully' }
} catch (error) { } catch (error) {
console.error('Error copying files:', error); console.error('Error copying files:', error);

View File

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

View File

@@ -2,7 +2,7 @@ import { useSettingsPageStatesStore } from "@/services/store";
import { useKvPairs } from "@/helpers/use-kvpairs"; import { useKvPairs } from "@/helpers/use-kvpairs";
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";
import { join } from "@tauri-apps/api/path"; import { join, dataDir } from "@tauri-apps/api/path";
import { platform } from "@tauri-apps/plugin-os"; import { platform } from "@tauri-apps/plugin-os";
import { useLogger } from "@/helpers/use-logger"; import { useLogger } from "@/helpers/use-logger";
import { toast } from "sonner"; import { toast } from "sonner";
@@ -18,10 +18,18 @@ export function useYtDlpUpdater() {
const updateYtDlp = async () => { const updateYtDlp = async () => {
const CURRENT_TIMESTAMP = Date.now(); const CURRENT_TIMESTAMP = Date.now();
const isFlatpak = await invoke<boolean>('is_flatpak'); const isFlatpak = await invoke<boolean>('is_flatpak');
const xdgDataDir = await dataDir();
setIsUpdatingYtDlp(true); setIsUpdatingYtDlp(true);
LOG.info('NEODLP', 'Updating yt-dlp to latest version'); LOG.info('NEODLP', 'Updating yt-dlp to latest version');
try { try {
const command = currentPlatform === 'linux' && !isFlatpak ? Command.create('pkexec', ['yt-dlp', '--update-to', ytDlpUpdateChannel]) : Command.sidecar('binaries/yt-dlp', ['--update-to', ytDlpUpdateChannel]); const command = currentPlatform === 'linux' && isFlatpak
// ? ytDlpUpdateChannel === 'nightly'
// ? Command.create('sh', ['-c', `PYTHONUSERBASE=${xdgDataDir}/pip python3 -m pip install --user --upgrade --pre "yt-dlp[default,curl-cffi]"`])
// : Command.create('sh', ['-c', `PYTHONUSERBASE=${xdgDataDir}/pip python3 -m pip install --user --upgrade "yt-dlp[default,curl-cffi]"`])
? Command.create('sh', ['-c', `${xdgDataDir}/yt-dlp/yt-dlp --update-to ${ytDlpUpdateChannel}`])
: currentPlatform === 'linux'
? Command.create('pkexec', ['yt-dlp', '--update-to', ytDlpUpdateChannel])
: Command.sidecar('binaries/yt-dlp', ['--update-to', ytDlpUpdateChannel]);
const output = await command.execute(); const output = await command.execute();
if (output.code === 0) { if (output.code === 0) {
console.log("yt-dlp updated successfully:", output.stdout); console.log("yt-dlp updated successfully:", output.stdout);

View File

@@ -1,4 +1,4 @@
import { BasePathsStore, CurrentVideoMetadataStore, DownloadActionStatesStore, DownloaderPageStatesStore, DownloadStatesStore, KvPairsStatesStore, LibraryPageStatesStore, LogsStore, SettingsPageStatesStore } from '@/types/store'; import { BasePathsStore, CurrentVideoMetadataStore, DownloadActionStatesStore, DownloaderPageStatesStore, DownloadStatesStore, EnvironmentStore, KvPairsStatesStore, LibraryPageStatesStore, LogsStore, SettingsPageStatesStore } from '@/types/store';
import { create } from 'zustand'; import { create } from 'zustand';
export const useBasePathsStore = create<BasePathsStore>((set) => ({ export const useBasePathsStore = create<BasePathsStore>((set) => ({
@@ -221,6 +221,8 @@ export const useSettingsPageStatesStore = create<SettingsPageStatesStore>((set)
use_potoken: false, use_potoken: false,
disable_innertube: false, disable_innertube: false,
pot_server_port: 4416, pot_server_port: 4416,
windows_filenames: true,
restrict_filenames: true,
// extension settings // extension settings
websocket_port: 53511 websocket_port: 53511
}, },
@@ -306,6 +308,8 @@ export const useSettingsPageStatesStore = create<SettingsPageStatesStore>((set)
use_potoken: false, use_potoken: false,
disable_innertube: false, disable_innertube: false,
pot_server_port: 4416, pot_server_port: 4416,
windows_filenames: true,
restrict_filenames: true,
// extension settings // extension settings
websocket_port: 53511 websocket_port: 53511
}, },
@@ -352,3 +356,12 @@ export const useLogsStore = create<LogsStore>((set) => ({
addLog: (log) => set((state) => ({ logs: [...state.logs, log] })), addLog: (log) => set((state) => ({ logs: [...state.logs, log] })),
clearLogs: () => set(() => ({ logs: [] })) clearLogs: () => set(() => ({ logs: [] }))
})); }));
export const useEnvironmentStore = create<EnvironmentStore>((set) => ({
isFlatpak: false,
isAppimage: false,
appDirPath: null,
setIsFlatpak: (isFlatpak) => set(() => ({ isFlatpak })),
setIsAppimage: (isAppimage) => set(() => ({ isAppimage })),
setAppDirPath: (path) => set(() => ({ appDirPath: path }))
}));

View File

@@ -64,6 +64,8 @@ export interface Settings {
use_potoken: boolean; use_potoken: boolean;
disable_innertube: boolean; disable_innertube: boolean;
pot_server_port: number; pot_server_port: number;
windows_filenames: boolean;
restrict_filenames: boolean;
// extension settings // extension settings
websocket_port: number; websocket_port: number;
} }

View File

@@ -152,3 +152,12 @@ export interface LogsStore {
addLog: (log: Log) => void; addLog: (log: Log) => void;
clearLogs: () => void; clearLogs: () => void;
} }
export interface EnvironmentStore {
isFlatpak: boolean;
isAppimage: boolean;
appDirPath: string | null;
setIsFlatpak: (isFlatpak: boolean) => void;
setIsAppimage: (isAppimage: boolean) => void;
setAppDirPath: (path: string) => void;
}