open-dynaMIX/simple-mpv-webui

webui.lua throws lua error

bamdadkhan opened this issue · 2 comments

when launching mpv it throws an error:
webui.lua:541: bad argument #1 to 'pairs' (table expected, got nil)

my setup is a raspberry pi 2 with devuan:

$ cat /etc/issue
Devuan GNU/Linux ascii \n \l
$ uname -a
Linux roadhouse 4.19.83-v7+ #1277 SMP Mon Nov 11 16:30:44 GMT 2019 armv7l GNU/Linux

what i did (mpv is already installed and working):

$ sudo apt install lua5.2 lua5.2-dev luarocks
$ sudo luarocks install luasocket
$ git clone https://github.com/open-dynaMIX/simple-mpv-webui.git
$ cp -a webui.lua webui-page ~/.config/mpv/scripts
$ mpv --no-video http://youtube.com/<something>

full error:

$ mpv --no-video 'https://youtu.be/C7L0eNPge98'
[webui]
[webui] stack traceback:
[webui]         [C]: in function 'pairs'
[webui]         /home/bamdad/simple-mpv-webui/webui.lua:541: in main chunk
[webui]         [C]: in ?
[webui]         [C]: in ?
[webui] Lua error: /home/bamdad/simple-mpv-webui/webui.lua:541: bad argument #1 to 'pairs' (table expected, got nil)
Playing: https://youtu.be/C7L0eNPge98

^C
Exiting... (Quit)

am i doing something horribly wrong?

thanks,
bamdad

Thanks for reporting this @bamdadkhan. This should be fixed in current master.

thanks for the quick fix. i confirm that it's working perfectly now.