Request: Flatpak Package
Flatpak is the universal app format for Linux-based operating systems. By packaging YTSage for Flatpak, users of any Linux system can install YTSage regardless of special configuration.
Would you be open to contributions that package YTSage for Flatpak and publish to the Flathub store?
Thanks for the interest in Flatpak packaging!
Unfortunately, YTSage isn't currently compatible with Flatpak's sandboxed environment due to a core feature requirement:
The issue: YTSage automatically updates the yt-dlp binary to ensure compatibility with YouTube's frequent changes. Flatpak's sandbox restrictions would prevent this auto-update functionality from working properly, as the app needs write access to update its bundled binaries.
Possible workarounds (but each has drawbacks):
- Bundle yt-dlp and require full Flatpak updates whenever yt-dlp updates → Users would lose the benefit of automatic yt-dlp updates
- Request broad filesystem permissions → Defeats the purpose of Flatpak's security model
- Use system yt-dlp instead of bundled → Would require users to manually update yt-dlp, and version compatibility could break
I'm keeping this issue open in case someone from the community wants to explore Flatpak packaging with an acceptable compromise, but it's not something I can prioritize given the architectural challenges.
If you have ideas on how to handle the yt-dlp auto-update requirement within Flatpak's constraints, I'd love to hear them!
@oop7 , thank you for the response and the examination of multiple possibilities.
There is one solution that I think would satisfy all of the requirements: Downloading to a "user data" location.
With flatpak, user data is stored under XDG_DATA_HOME (environment variable) directory, while cache data is stored under the XDG_CACHE_HOME directory. I think yt-dlp could suitably be downloaded and stored to either location in the same manner that you currently handle non-flatpak installations.
With regard to implementation, I think this could involve a single line change to https://github.com/oop7/YTSage/blob/60a6eecc753fbdab4afd4bff1abbd10531aa99b0/src/utils/ytsage_constants.py#L135
Either the flatpak packaging config could include a patch affecting this line, or your could change this line to accept an environment variable such as "YTDLP_APP_BIN_PATH" and set the environment variable in the flatpak package start script.
Would this be acceptable?