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

Support for Celluloid #7

Open
ak-42 opened this issue Mar 6, 2020 · 5 comments
Open

Support for Celluloid #7

ak-42 opened this issue Mar 6, 2020 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@ak-42
Copy link

ak-42 commented Mar 6, 2020

I understand that you're officially supporting only mpv, so if you consider this out of scope, please consider it a feature suggestion.

I've tried to run mpv_sponsorblock under Celluloid and it does not seem to work. :(

If you're not familiar, Celluloid is a GTK frontend for mpv. It supports most of mpv's configs and scripts, at least according to the readme.
Any chance you could add support for it?

Thanks for doing this project, even without Celluloid support, it is amazing.

@po5
Copy link
Owner

po5 commented Mar 10, 2020

Their readme claims the only compatibility issues with user scripts are keybindings.

I'm not sure what could be breaking, do you have any error logs to share?

@ak-42
Copy link
Author

ak-42 commented Mar 10, 2020

I got this:

❯❯❯ G_MESSAGES_DEBUG=info celluloid --mpv-options='--msg-level=all=trace' "https://www.youtube.com/watch?v=q68JyiRc1GQ" &> output.txt
<content removed>
** Message: 14:38:01.136: [sponsorblock] reading options for sponsorblock 
** Message: 14:38:01.136: [ffmpeg] Opening https://www.youtube.com/watch?v=q68JyiRc1GQ
** Message: 14:38:01.136: [sponsorblock] script-opts/sponsorblock.conf not found. 
** Message: 14:38:01.136: [sponsorblock] lua-settings/sponsorblock.conf not found. 
** Message: 14:38:01.136: [ffmpeg] https: Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
** Message: 14:38:01.136: [sponsorblock] stack traceback:
** Message: 14:38:01.136: [sponsorblock] 	[C]: in function 'join_path'
** Message: 14:38:01.136: [sponsorblock] 	/home/username/.config/celluloid/scripts/sponsorblock.lua:74: in main chunk
** Message: 14:38:01.136: [sponsorblock] 	[C]: in ?
** Message: 14:38:01.136: [sponsorblock] 	[C]: in ?
** Message: 14:38:01.136: [sponsorblock] Lua error: /home/username/.config/celluloid/scripts/sponsorblock.lua:74: bad argument #1 to 'join_path' (string expected, got nil)
** Message: 14:38:01.136: [sponsorblock] Exiting...
<content removed>

Obviously this is only the parts that seem relevant for sponsor block, the whole output was cloose to 5mb in size.

I hope that helps.

@po5
Copy link
Owner

po5 commented Mar 11, 2020

So mp.find_config_file("scripts") is returning nil.

Does it work if you replace line 74 with this?

local scripts_dir = mp.command_native({"expand-path", "~~/scripts/"})

Will update the script if that does fix it.

@ak-42
Copy link
Author

ak-42 commented Mar 11, 2020

After replacing line 74 it is still not working. New logs:

❯❯❯ G_MESSAGES_DEBUG=info celluloid --mpv-options='--msg-level=all=trace' "https://www.youtube.com/watch?v=q68JyiRc1GQ" &> output.txt
<content removed>
** Message: 18:42:46.864: [cplayer] Run command: load-script, flags=64, args=["/home/username/.config/celluloid/scripts/sponsorblock.lua"]
** Message: 18:42:46.864: [global] user path: '/home/username/.config/celluloid/scripts/sponsorblock.lua' -> '/home/username/.config/celluloid/scripts/sponsorblock.lua'
** Message: 18:42:46.864: [sponsorblock] Loading lua script /home/username/.config/celluloid/scripts/sponsorblock.lua...
** Message: 18:42:46.864: [sponsorblock] loading mp.defaults
** Message: 18:42:46.864: [sponsorblock] loading file /home/username/.config/celluloid/scripts/sponsorblock.lua
** Message: 18:42:46.864: [sponsorblock] reading options for sponsorblock 
** Message: 18:42:46.864: [sponsorblock] script-opts/sponsorblock.conf not found. 
** Message: 18:42:46.864: [sponsorblock] lua-settings/sponsorblock.conf not found. 
** Message: 18:42:46.864: [cplayer] Run command: expand-path, flags=64, args=["~~/scripts/"]
** Message: 18:42:46.864: [global] user path: '~~/scripts/' -> 'scripts/'
** Message: 18:42:46.864: [cplayer] Run command: define-section, flags=64, args=["input_sponsorblock", "g script-binding sponsorblock/sponsorblock_set_segment\nG script-binding sponsorblock/sponsorblock_submit_segment\nh script-binding sponsorblock/sponsorblock_upvote\nH script-binding sponsorblock/sponsorblock_downvote\n", "default"]
** Message: 18:42:46.864: [input] add: section='input_sponsorblock' key='g' builtin cmd='script-binding sponsorblock/sponsorblock_set_segment' location='<api>:1'
** Message: 18:42:46.864: [input] add: section='input_sponsorblock' key='G' builtin cmd='script-binding sponsorblock/sponsorblock_submit_segment' location='<api>:2'
** Message: 18:42:46.864: [input] add: section='input_sponsorblock' key='h' builtin cmd='script-binding sponsorblock/sponsorblock_upvote' location='<api>:3'
** Message: 18:42:46.864: [input] add: section='input_sponsorblock' key='H' builtin cmd='script-binding sponsorblock/sponsorblock_downvote' location='<api>:4'
** Message: 18:42:46.864: [cplayer] Run command: enable-section, flags=64, args=["input_sponsorblock", "allow-hide-cursor+allow-vo-dragging"]
** Message: 18:42:46.864: [input] enable section 'input_sponsorblock'
** Message: 18:42:46.864: [input] active section stack:
** Message: 18:42:46.864: [input]  default 12
** Message: 18:42:46.864: [input]  input_stats 12
** Message: 18:42:46.864: [input]  input_forced_stats 12
** Message: 18:42:46.864: [input]  input_console 12
** Message: 18:42:46.864: [input]  input_forced_console 12
** Message: 18:42:46.864: [input]  input_sponsorblock 12
** Message: 18:42:46.864: [cplayer] Run command: define-section, flags=64, args=["input_forced_sponsorblock", "", "force"]
** Message: 18:42:46.864: [cplayer] Run command: enable-section, flags=64, args=["input_forced_sponsorblock", "allow-hide-cursor+allow-vo-dragging"]
** Message: 18:42:46.864: [input] enable section 'input_forced_sponsorblock'
** Message: 18:42:46.864: [input] active section stack:
** Message: 18:42:46.864: [input]  default 12
** Message: 18:42:46.864: [input]  input_stats 12
** Message: 18:42:46.864: [input]  input_forced_stats 12
** Message: 18:42:46.864: [input]  input_console 12
** Message: 18:42:46.864: [input]  input_forced_console 12
** Message: 18:42:46.864: [input]  input_sponsorblock 12
** Message: 18:42:46.864: [input]  input_forced_sponsorblock 12
<content removed>
** Message: 18:42:53.331: [sponsorblock] stack traceback:
** Message: 18:42:53.331: [sponsorblock] 	[C]: in function 'raw_command_native_async'
** Message: 18:42:53.331: [sponsorblock] 	mp.defaults:563: in function 'command_native_async'
** Message: 18:42:53.331: [sponsorblock] 	/home/username/.config/celluloid/scripts/sponsorblock.lua:271: in function 'update'
** Message: 18:42:53.331: [sponsorblock] 	/home/username/.config/celluloid/scripts/sponsorblock.lua:333: in function 'handler'
** Message: 18:42:53.331: [sponsorblock] 	mp.defaults:486: in function 'call_event_handlers'
** Message: 18:42:53.331: [sponsorblock] 	mp.defaults:520: in function 'dispatch_events'
** Message: 18:42:53.331: [sponsorblock] 	mp.defaults:479: in function <mp.defaults:478>
** Message: 18:42:53.331: [sponsorblock] 	[C]: in ?
** Message: 18:42:53.331: [sponsorblock] 	[C]: in ?
** Message: 18:42:53.331: [sponsorblock] Lua error: mp.defaults:563: key must be a string, but got number
** Message: 18:42:53.331: [sponsorblock] Exiting...
<content removed>

@po5 po5 added the help wanted Extra attention is needed label Apr 15, 2020
@user18130814200115-2
Copy link

You can manually set the path in order for the plugin to work with celluloid.

In sponsorblock.lua:

-- scripts_dir = mp.find_config_file("scripts")
scripts_dir = "/home/[INSERT USERNAME]/.config/celluloid/scripts/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants