cvzi / mpv-youtube-upnext

A userscript for MPV that allows you to play "up next"/recommended youtube videos ⏭️
Other
61 stars 8 forks source link

Lua error on launch #35

Closed jansendotsh closed 11 months ago

jansendotsh commented 1 year ago

Seeing a Lua error dumped to terminal when launching with this in macOS:

[youtube_upnext]
[youtube_upnext] stack traceback:
[youtube_upnext]        [C]: ?
[youtube_upnext]        [C]: ?
[youtube_upnext] Lua error: /Users/garrettjansen/.config/mpv/scripts/youtube-upnext.lua:716: '=' expected near 'continue'

Looks like this might be an issue with Lua compatibility based on sponsorblock having a similar issue. MPV version:

mpv --version
mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Mon Jul 24 01:30:19 2023
FFmpeg version: 5.1.3
FFmpeg library versions:
   libavutil       57.28.100
   libavcodec      59.37.100
   libavformat     59.27.100
   libswscale      6.7.100
   libavfilter     8.44.100
   libswresample   4.7.100
cvzi commented 1 year ago

Thanks for the detailed report.

I see, older Lua versions don't have the goto-statement yet 🫤

cvzi commented 1 year ago

I wonder why your mpv has a lower Lua version though, because I run an automated test with Github actions on a virtual macos machine and the script works fine there

cvzi commented 1 year ago

Maybe this will work: https://github.com/cvzi/mpv-youtube-upnext/blob/lua-5-1/youtube-upnext.lua

NaiveInvestigator commented 11 months ago

I get this error too on Nobara Linux.

error log:

 [youtube_upnext] 
[youtube_upnext] stack traceback:
[youtube_upnext]        [C]: ?
[youtube_upnext]        [C]: ?
[youtube_upnext] Lua error: /home/maelstrom/.config/mpv/scripts/youtube-upnext.lua:716: '=' expected near 'continue'

mpv version:

mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       58.2.100
   libavcodec      60.3.100
   libavformat     60.3.100
   libswscale      7.1.100
   libavfilter     9.3.100
   libswresample   4.10.100
FFmpeg version: 6.0.1

Using #36 fixes the issue for me.

cvzi commented 11 months ago

Thanks!