sc0ty / subsync

Subtitle Speech Synchronizer
GNU General Public License v3.0
1.28k stars 54 forks source link

error on Ubuntu 18.04 #8

Closed huuub closed 5 years ago

huuub commented 5 years ago

Can't get it to work. I tried using it with snapd error : subsync --sub="t.srt" --sub-stream=1 --sub-lang=nl --ref='./t.mkv' --ref-stream=1 --ref-lang=tm --out="out.srt" --auto=done --logfile log

  File "/snap/subsync/4/bin/subsync", line 11, in <module>
    load_entry_point('subsync==0.9.0', 'gui_scripts', 'subsync')()
  File "/snap/subsync/4/lib/python3.5/site-packages/subsync/__main__.py", line 21, in subsync
    subs, refs, args = parseCmdArgs(sys.argv)
  File "/snap/subsync/4/lib/python3.5/site-packages/subsync/__main__.py", line 138, in parseCmdArgs
    subs = Stream(path=args.sub, types=('subtitle/text',))
  File "/snap/subsync/4/lib/python3.5/site-packages/subsync/stream.py", line 18, in __init__
    self.open(path)
  File "/snap/subsync/4/lib/python3.5/site-packages/subsync/stream.py", line 27, in open
    ss = gizmo.Demux(path).getStreamsInfo()
gizmo.Error: can't open multimedia file: Permission denied
code: -13
file: t.srt
module: Demux.avformat_open_input
source: media/demux.cpp:37  Demux::Demux(const string&)
sc0ty commented 5 years ago

Snaps has limited access to filesystem. Subsync could access only user home directory and mounted media. If your files are somewhere else, it may not be visible to subsync. Please check if you could navigate to your file via GUI to be sure. You could override this behaviour if you trust me enough using classic confinement.

huuub commented 5 years ago

hmmm that did not help : sudo snap install subsync --classic Warning: flag --classic ignored for strictly confined snap subsync

subsync 0.9 from Michał Szymaniak (sc0typl) installed

huuub commented 5 years ago

I installed with dev-mode... That worked but now I get: subsync \

--sub='/media/data/complete/tvsonarr/Game of Thrones/Season 8/t.srt' \ --sub-stream=1 \ --sub-lang=nl \ --ref='/media/data/complete/tvsonarr/Game of Thrones/Season 8/t.mkv' \ --ref-stream=2 \ --ref-lang=en \ --out="/media/data/complete/tvsonarr/Game of Thrones/Season 8/out.srt" \ --auto=done Unable to access the X Display, is $DISPLAY set properly?

sc0ty commented 5 years ago

Are you trying to run it without graphical desktop environment? It won't work that way, even when run from terminal it still tries to show GUI.

huuub commented 5 years ago

Hmmm there is even x11 interface on docker. But a pity. Was really looking forward to integrate it with bazarr. It would be really great if this would run without and we are able to use it in bulk to scan folders. Any plans on making this? Anayway really great project.

sc0ty commented 5 years ago

I am working on command line version already, I think it will be included in the next release. Not sure what bazarr is (nor sonarr or radarr which google is pointing me to), but I understand you need version of subsync to be called from terminal or some kind of script?

And I'm not sure why you can't use classic confinement, my knowledge of snaps is rather limited.

About your command line parameters - languages are selected with three letter codes. So you should use --ref-lang=eng and --sub-lang=dut (I think). I will describe command line arguments extensively when I'll have command line version ready.

huuub commented 5 years ago

Sounds great! I also don't know anything about snaps... I would prefer docker :)

linderlake commented 5 years ago

I had this issue and after struggling a bit I ended up here on google. So for future reference I will add my solution below:

  1. re-install the subsync snap package with --classic flag (this step might not be needed but I did this)
  2. issue "sudo snap connect subsync:removable-media", this will give subsync permissions to your removable storage (ie the folders in /media/).

That's it.

sc0ty commented 5 years ago

removable-media is already listed in plugin section in snap.yaml, it should have access to /media without extra steps (and user home dir).

Erbros commented 4 years ago
  1. issue "sudo snap connect subsync:removable-media", this will give subsync permissions to your removable storage (ie the folders in /media/).

Thank you! This fixed my issue as well. I didn't need step 1.