JKubovy / MPV-Watch-Later-OSD-Menu

This is a Lua script for the MPV media player that shows a list of the saved files in the "watch later" directory in an interactive menu.
The Unlicense
1 stars 0 forks source link

Lua error: `watch_later_osd_menu.lua:51`: bad argument #5

Closed scillidan closed 3 weeks ago

scillidan commented 1 month ago

Dude, I use script on Windows 10. But it return errors:

[watch_later_osd_menu]
[watch_later_osd_menu] stack traceback:
[watch_later_osd_menu]  ...e\mpv\_config_dir_manga/scripts/watch_later_osd_menu.lua:51: in function 'parse_watch_later_files'
[watch_later_osd_menu]  ...e\mpv\_config_dir_manga/scripts/watch_later_osd_menu.lua:275: in function 'load_globals'
[watch_later_osd_menu]  ...e\mpv\_config_dir_manga/scripts/watch_later_osd_menu.lua:281: in function 'fn'
[watch_later_osd_menu]  mp.defaults:233: in function 'fn'
[watch_later_osd_menu]  mp.defaults:66: in function 'handler'
[watch_later_osd_menu]  mp.defaults:385: in function 'handler'
[watch_later_osd_menu]  mp.defaults:515: in function 'call_event_handlers'
[watch_later_osd_menu]  mp.defaults:557: in function 'dispatch_events'
[watch_later_osd_menu]  mp.defaults:508: in function <mp.defaults:507>
[watch_later_osd_menu]  [C]: at 0x7ff744226200
[watch_later_osd_menu]  [C]: at 0x7ff744225050
[watch_later_osd_menu] Lua error: ...e\mpv\_config_dir_manga/scripts/watch_later_osd_menu.lua:51: bad argument #1 to 'ipairs' (table expected, got nil)
JKubovy commented 4 weeks ago

It looks like the function "utils.readdir(watch_later_path, 'files')" returned nil instead of a list of files. Did you follow the installation instructions?

scillidan commented 3 weeks ago

I read README.md again. I think I did installing correctly.

JKubovy commented 3 weeks ago

What version of mpv do you have? Native command "expand-path" was added in version 0.30 https://github.com/mpv-player/mpv/commit/4247a54d98dd386056308d6d275a35a7ad77becb

... or path "~~home/watch_later" not working correctly.

scillidan commented 3 weeks ago

My mpv version:

mpv v0.38.0-745-gecc6cdde Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Sep  5 2024 00:06:55
libplacebo version: v7.349.0 (v7.349.0-9-gefb8934-dirty)
FFmpeg version: N-116861-gd9f594209
FFmpeg library versions:
   libavcodec      61.11.100
   libavdevice     61.2.100
   libavfilter     10.2.102
   libavformat     61.5.101
   libavutil       59.35.100
   libswresample   5.2.100
   libswscale      8.2.100

When I only keep watch_later_osd_menu.lua, watch_later_osd_menu.conf, it works well. Seems it conflict with other scripts I used (I installed lots of scripts 😂). I'm glad remembered that I should do testing by this way.

It solves :) Anyway, thanks for your time.