open-dynaMIX / simple-mpv-webui

A web based user interface with controls for the mpv mediaplayer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find main.* for any supported scripting backend in: ~/.config/mpv/scripts/webui-page

maksymsan opened this issue · comments

I installed webui 2.1.0 in ~/.config/mpv/scripts, and mpv always prints this error message during start:
Cannot find main.* for any supported scripting backend in: ~/.config/mpv/scripts/webui-page

mpv.log

Webui seems to be working well.
Is anything wrong with my configuration?

Thanks a lot for reporting this @maksymsan!

mpv recently added support for loading scripts from directories, which is awesome. In order for this to work, the main script file in a script directory must be called main.*. If you added the webui with the webui-page dir into your scripts directory, mpv complains, it doesn't find a user script inside webui-page. That's normal, because this directory does not contain any userscript, but the static files served by the webui. As mpv is still correctly loading the webui userscript, there's nothing broken with your setup, except for having this message.

I've tried to adapt to the new way of including userscripts from directories (i.e. renaming webui.lua into main.lua), but unfortunately it is not 100% backward compatible for users using mpv < 0.33. That's why I've decided to wait a bit in order to keep the impact smaller.

If you want to get rid of the message, you can move the webui outside of the mpv scripts directory and include it with the --script option.

commented

I have the same error, but also a Lua error:

Cannot find main.* ...
f@FRANC-MACBOOK:~/.config/mpv/scripts$ mpv /Users/f/Documents/Filme/triplettes.avi
Cannot find main.* for any supported scripting backend in: /Users/f/.config/mpv/scripts/webui-page
[webui] 
[webui] stack traceback:
[webui] 	[C]: in ?
[webui] 	[C]: in function 'require'
[webui] 	/usr/local/Cellar/luarocks/3.7.0/share/lua/5.4/socket.lua:12: in main chunk
[webui] 	[C]: in function 'require'
[webui] 	[string "/Users/f/.config/mpv/scripts/webui.lua"]:4: in main chunk
[webui] 	[C]: in ?
[webui] 	[C]: in ?
[webui] Lua error: error loading module 'socket.core' from file '/usr/local/lib/lua/5.4/socket/core.so':
[webui] 	dlopen(/usr/local/lib/lua/5.4/socket/core.so, 6): Symbol not found: _lua_newuserdatauv
[webui]   Referenced from: /usr/local/lib/lua/5.4/socket/core.so
[webui]   Expected in: flat namespace
[webui]  in /usr/local/lib/lua/5.4/socket/core.so
 (+) Video --vid=1 (mpeg4 640x368 25.000fps)
 (+) Audio --aid=1 (mp3 2ch 48000Hz)
[vo/gpu] opengl cocoa backend is deprecated, use vo=libmpv instead
AO: [coreaudio] 48000Hz stereo 2ch floatp
VO: [gpu] 640x368 yuv420p
AV: 00:00:06 / 01:17:21 (0%) A-V:  0.000 Dropped: 1

On http://127.0.0.1:8080 there is nothing, so no webserver running :(
Is the Lua error (error loading module 'socket.core' - see colapsed code-details) maybe not related with the missing main?
mpv -v shows me ...--lua=52fbsd... but I cannot find 5.2 in brew, only 5.4

What could that be?
Thanks.

commented

OK, I installed it on Wincows 10 (64-Bit) with the pre-compiled Lua dll etc from the other repo and it works initially without any problems. The same warning is present, from this very issue, but I just ignore it 😄
My issue with Mac OS 10.11.6 and Lua 5.4 from above:

Lua error
[webui] Lua error: error loading module 'socket.core' from file '/usr/local/lib/lua/5.4/socket/core.so':
[webui] 	dlopen(/usr/local/lib/lua/5.4/socket/core.so, 6): Symbol not found: _lua_newuserdatauv
[webui]   Referenced from: /usr/local/lib/lua/5.4/socket/core.so
[webui]   Expected in: flat namespace
[webui]  in /usr/local/lib/lua/5.4/socket/core.so

is likely about the wrong Lua (5.4 instead of 5.1 or 5.2?), my guess.
But not so important, I wont use it on Mac anyway, I need it on Windows, which is my media PC.
I was already astonished that the Lua 5.4 was installed by brew at all on Mac, as the brew is often not installing and compiling packages on this old OS (brew on 10.11 is not anymore supported, no way to fix that).

Anyway, I tried then with downgrading to Lua 5.1 (there is no 5.2 but my mpv -v says lua=5.2 fbsd something) with brew but still the socket is not working. I pass.

Nice work, by the way, thanks a lot for this GUI 🤣

commented

I've tried to adapt to the new way of including userscripts from directories (i.e. renaming webui.lua into main.lua), but unfortunately it is not 100% backward compatible for users using mpv < 0.33. That's why I've decided to wait a bit in order to keep the impact smaller.

If you want to get rid of the message, you can move the webui outside of the mpv scripts directory and include it with the --script option.

I just created an empty file called main.lua into the webui-page directory and now the warning is away :)
So this is on Windows, but I guess the same for *nix systems.

Hey @francwalter

Nice, that you were able to solve your issue.

I just created an empty file called main.lua into the webui-page directory and now the warning is away :)

This might be a workaround, but the proper fix is in #326 waiting to be finished and merged. Some more explanation is in the first comment of this issue.

commented

This was the first thing I tried, renaming webui.lua to main.lua, but there was still the same warning message.
Only with a main.lua file (empty) inside the webui-page directory the warning dissapeared 😄

I think there was something else wrong, because I'm using that branch since quite some time.