interSubs icon indicating copy to clipboard operation
interSubs copied to clipboard

Script doesn't work without terminal on macOS Ventura 13.3

Open adriannedbailo opened this issue 2 years ago • 7 comments

I'm encountering an issue where I can't launch MPV when opening a video without using the terminal. Additionally, there's another minor problem that I didn't face when using Linux. MPV doesn't seem to respond when I focus on the subtitle window, and vice versa — subtitles don't work when the playback window is in focus. For instance, I'm unable to interact with the keyboard when the subtitle window is active. I can see both components, but unfortunately, they don't seem to interact with each other simultaneously.

adriannedbailo avatar Oct 21 '23 14:10 adriannedbailo

I don't use Mac. So I can't help.

oltodosel avatar Oct 21 '23 21:10 oltodosel

When I launch this script using mpv via Finder, it doesn't run. Yet, it works correctly when initiated through the terminal. I suspect the difference lies in the environments of Finder and the terminal. While I'm familiar with the terminal's environment, I'm unsure about Finder's. Is there a way to either modify the script or provide it permissions so it doesn't depend on Finder?

There is a list of environment variables from a terminal session on a macOS system. __CFBundleIdentifier=com.apple.Terminal TMPDIR=/var/folders/ct/l54j1pgd3tzckfnjznlr3rtr0000gn/T/ XPC_FLAGS=0x0 LaunchInstanceID=BD8501C3-CB44-40DA-AEF1-B3DCFC0230B1 TERM=xterm-256color SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Q7Riaf1GLT/Listeners SECURITYSESSIONID=186b4 XPC_SERVICE_NAME=0 TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=447 TERM_SESSION_ID=AB2CFC2C-CBCE-47CB-AB9E-53343DE4C6ED SHELL=/bin/zsh HOME=/Users/arturanovskij LOGNAME=arturanovskij USER=arturanovskij PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin SHLVL=1 PWD=/Users/arturanovskij OLDPWD=/Users/arturanovskij HOMEBREW_PREFIX=/opt/homebrew HOMEBREW_CELLAR=/opt/homebrew/Cellar HOMEBREW_REPOSITORY=/opt/homebrew MANPATH=/opt/homebrew/share/man:: INFOPATH=/opt/homebrew/share/info: LANG=uk_UA.UTF-8 _=/opt/homebrew/bin/python3 __CF_USER_TEXT_ENCODING=0x1F5:0x7:0x3E

adriannedbailo avatar Oct 24 '23 18:10 adriannedbailo

https://man.archlinux.org/man/mpv.1#load~4 --load-osd-console=<yes|no> Enable the built-in script that shows a console on a key binding and lets you enter commands (default: yes). The ` key is used to show the console by default, and ESC to hide it again.

This way you'd be able to see console output right in the mpv and find out errors that the script might give.

oltodosel avatar Oct 24 '23 21:10 oltodosel

Знімок екрана 2023-10-25 о 09 23 14 Знімок екрана 2023-10-25 о 09 24 15 Regrettably it doesn't work and it's unclear why.

adriannedbailo avatar Oct 25 '23 06:10 adriannedbailo

Evidently the python part of the script does not start. The problem must be here: https://github.com/oltodosel/interSubs/blob/990ea55a2da0a9c307da75449e8982a190f8eb93/interSubs.lua#L22 or/and here: https://github.com/oltodosel/interSubs/blob/990ea55a2da0a9c307da75449e8982a190f8eb93/interSubs.lua#L69

Try entering full path instead on line 22.

oltodosel avatar Oct 25 '23 06:10 oltodosel

Evidently the python part of the script does not start. The problem must be here:

https://github.com/oltodosel/interSubs/blob/990ea55a2da0a9c307da75449e8982a190f8eb93/interSubs.lua#L22

or/and here: https://github.com/oltodosel/interSubs/blob/990ea55a2da0a9c307da75449e8982a190f8eb93/interSubs.lua#L69

Try entering full path instead on line 22.

I've tried the first step, and it didn't help. I didn't understand what I should change in line 69, can you help me with that?

adriannedbailo avatar Oct 29 '23 13:10 adriannedbailo

I was wrong about the python part not starting, it very well might be. Console within mpv does not show output from the python script for some reason. I missed that, though your second screenshot clearly shows that.

You can try adding environment variables that your terminal uses right into here: https://github.com/oltodosel/interSubs/blob/990ea55a2da0a9c307da75449e8982a190f8eb93/interSubs.lua#L13 It should look like this: start_command = 'ENV1=ENV1 ENV2=ENV2 python3 "%s" "%s" "%s"'

python3 should be changed to what your Mac uses

P.S. Не забувай донатити на дрони.

oltodosel avatar Oct 29 '23 14:10 oltodosel