Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: access to locally installed app #66

Closed
arvigeus opened this issue May 11, 2022 · 11 comments
Closed

Question: access to locally installed app #66

arvigeus opened this issue May 11, 2022 · 11 comments

Comments

@arvigeus
Copy link

I am trying to add mpv-autosub plugin, which requires subliminal. I tried to give mpv access to ~/.local/bin and set ~/.local/bin/subliminal in the plugin config, but it still does not work. What am I missing?

@Erick555
Copy link
Contributor

Flatpak apps are isolated from other apps.

@fastrizwaan
Copy link
Collaborator

I've added subliminal-wrapper, with this commit 451f4d2

Install subliminal with pip install subliminal

Please make --host or --home writeable for downloads to work, using flatseal

autosub.lua script is not downloading subtitle,
but subliminal wrapper inside flatpak is downloading.

flatpak run --filesystem=host --command=bash io.mpv.Mpv 
[📦 io.mpv.Mpv Uncharted]$ subliminal download -l en  uncharted.mkv 
Collecting videos  [####################################]  100%               
1 video collected / 0 video ignored / 0 error
Downloading subtitles  [####################################]  100%     

@fastrizwaan
Copy link
Collaborator

you may test with flatpak install https://dl.flathub.org/build-repo/88527/io.mpv.Mpv.flatpakref

@arvigeus
Copy link
Author

[arvigeus@fedora ~]$ flatpak run --filesystem=host --command=bash io.mpv.Mpv 
[📦 io.mpv.Mpv ~]$ subliminal -v
Traceback (most recent call last):
  File "/var/home/arvigeus/.local/bin/subliminal", line 5, in <module>
    from subliminal.cli import subliminal
ModuleNotFoundError: No module named 'subliminal'

Anyway, I don't think this is the right way to do it (manually writing what I want). Probably I should just make a shell script that automates this. Or use VLC because it has similar functionality.

Thanks for the swift response!

@fastrizwaan
Copy link
Collaborator

fastrizwaan commented May 11, 2022

Anyway, I don't think this is the right way to do it (manually writing what I want). Probably I should just make a shell script that automates this. Or use VLC because it has similar functionality.

I think the autosub.lua script has issue with variable local subliminal= it should just use $PATH instead of absolute path, so that wrappers work.

Thanks for the swift response!

You're welcome!

@Erick555
Copy link
Contributor

Erick555 commented May 11, 2022

If the solution wasn't accepted by original reporter then I think merging it in main repo was premature. The --talk-name=org.freedesktop.Flatpak practically turns off sandbox security.

@fastrizwaan
Copy link
Collaborator

Reverted subliminal wrapper. Security is important. b8877ca

@Erick555
Copy link
Contributor

One option would be to add subminimal into fatpak although it has significant number of python dependencies.

@fastrizwaan fastrizwaan reopened this May 13, 2022
@fastrizwaan
Copy link
Collaborator

fastrizwaan commented May 13, 2022

Included subliminal with commit 4d88d8b

autosub.lua downloads subtitles as expected.

@arvigeus kindly test. make sure write permission to HOME or HOST for downloading subtitles and

set local subliminal = '/app/bin/subliminal' in autosub.lua file.

flatpak install https://dl.flathub.org/build-repo/89044/io.mpv.Mpv.flatpakref

@arvigeus
Copy link
Author

Works like a charm! Maybe this should be added as a listed feature in flathub description?

@fastrizwaan
Copy link
Collaborator

autosub.lua installation notes

cd /tmp
git clone https://github.com/davidde/mpv-autosub.git
cd mpv-autosub/
sed "s/local subliminal = .*$/local subliminal = '\/app\/bin\/subliminal/g" -i autosub.lua 
mkdir -p ~/.var/app/io.mpv.Mpv/config/mpv/scripts/
cp autosub.lua ~/.var/app/io.mpv.Mpv/config/mpv/scripts/
flatpak --user override --filesystem=host io.mpv.Mpv ; # to download subtitles in the same directory containing video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants