CrendKing / mpv-twitch-chat

Show Twitch chat messages as subtitles when watching Twitch VOD with mpv.
MIT License
89 stars 4 forks source link

script doesn't work for Lua version < 5.2 #15

Closed NaiveInvestigator closed 1 year ago

NaiveInvestigator commented 1 year ago

I get this error when running mpv

[mpv_twitch_chat] 
[mpv_twitch_chat] stack traceback:
[mpv_twitch_chat]       [C]: ?
[mpv_twitch_chat]       [C]: ?
[mpv_twitch_chat] Lua error: /home/maelstrom/.config/mpv/scripts/mpv-twitch-chat.lua:141: '=' expected near 'continue'

Distro details:

                                                                                                                        maelstrom@Legion 
    ⠀⠀⢀⣤⣴⣶⣶⣶⣦⣤⡀⠀⣀⣠⣤⣴⣶⣶⣶⣶⣶⣶⣶⣶⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀   ---------------- 
    ⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀   OS: Nobara Linux 37 (KDE Plasma) x86_64 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀   Host: 82B1 Lenovo Legion 5 15ARH05H 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀   Kernel: 6.1.14-201.fsync.fc37.x86_64 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀   Uptime: 22 mins 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠉⠁⠀⠀⠉⠉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀   Packages: 2449 (rpm) 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⢀⣀⣀⡀⠀⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀   Shell: bash 5.2.15 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀⠀⢠⣾⣿⣿⣿⣿⣷⡄⠀⠀⠀⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀   Resolution: 1920x1080 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⣀⣀⣬⣽⣿⣿⣿⣿⣿⣿⠀   DE: Plasma 5.27.2 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠈⠻⢿⣿⣿⡿⠟⠁⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀   WM: kwin 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀   Theme: [Plasma], Breeze [GTK2/3] 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀   Icons: [Plasma], breeze-dark [GTK2/3] 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀   Terminal: konsole 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀   CPU: AMD Ryzen 7 4800H with Radeon Graphics (16) @ 2.900GHz 
    ⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠉⠉⠛⠛⢿⣿⣿⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀   GPU: NVIDIA GeForce RTX 2060 Mobile 
    ⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀   Memory: 3709MiB / 15862MiB 
    ⠀⠀⠀⠈⠙⠛⠛⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠛⠛⠛⠉⠁⠀⠀⠀

mpv version:

mpv 0.35.0 Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
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
FFmpeg version: 5.1.2
CrendKing commented 1 year ago
  1. Isn't Lua embedded in mpv? It looks like mpv's Lua is guaranteed >= 5.2, so why do you put "< 5.2" in the title?
  2. There is no "continue" around line 141 in the script. Maybe your installation went wrong?
NaiveInvestigator commented 1 year ago

Isn't Lua embedded in mpv? It looks like mpv's Lua is guaranteed >= 5.2, so why do you put "< 5.2" in the title?

I had a similar issue where i got this kind of error in another script, so I assumed it is the same one of this script. I maybe be totally wrong tho sorry. https://github.com/vc-01/metadata-osd/issues/11

There is no "continue" around line 141 in the script. Maybe your installation went wrong?

oh sorry i didn't update to the latest version of this script. this is the new error log.

[mpv_twitch_chat] 
[mpv_twitch_chat] stack traceback:
[mpv_twitch_chat]       [C]: ?
[mpv_twitch_chat]       [C]: ?
[mpv_twitch_chat] Lua error: /home/maelstrom/.config/mpv/scripts/mpv-twitch-chat.lua:205: unexpected symbol near ':'
NaiveInvestigator commented 1 year ago

image The script seems to be working!!

CrendKing commented 1 year ago

I was wrong above that mpv still supports both Lua 5.1 and 5.2. It seems you built mpv yourself, and your Lua dependency is probably 5.1. Some people (including myself) use prebuilt versions such as shinchiro's which already embeds Lua 5.2.

Anyway, that "continue" label is obsolete so I removed it. You should be fine now.

NaiveInvestigator commented 1 year ago

Ah actually I didn't, I am using nobara-appstream's version of mpv, which is patched for that particular distro to reduce headaches for ppl, not so sure why they build it with 5.1 .

https://nobaraproject.org/ (see below)

TYSM for fixing it!! Really appreciate it! Have a pleasant day / night.

CrendKing commented 1 year ago

not so sure why they build it with 5.1

Probably because it's the minimum requirement from mpv, and some project tend to be on the more conservative side. If you use other scripts that requires 5.2 features, you probably should start talking to Nobara folks. Otherwise, enjoy.