oltodosel / mpv-scripts

My and adopted lua scripts for mpv.
MIT License
30 stars 4 forks source link

[Fix] for windows users #13

Closed Rickyrvxlovet closed 1 month ago

Rickyrvxlovet commented 1 month ago

When i press F12 it says. F12 is not mapped

oltodosel commented 1 month ago

Put the script into ~/.config/mpv/scripts/

Rickyrvxlovet commented 1 month ago

Put the script into ~/.config/mpv/scripts/

I did

oltodosel commented 1 month ago

Open mpv through cmd and see if there are any errors.

Rickyrvxlovet commented 1 month ago

Put the script into ~/.config/mpv/scripts/

mpv v0.38.0-567-g68a1a387 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects built on Jun 29 2024 00:14:16 libplacebo version: v7.349.0 (v7.349.0-rc1-3-g1fd3c7b-dirty) FFmpeg version: N-116052-gd5e603ddc FFmpeg library versions: libavcodec 61.9.100 libavdevice 61.2.100 libavfilter 10.2.102 libavformat 61.4.100 libavutil 59.27.100 libswresample 5.2.100 libswscale 8.2.100

Rickyrvxlovet commented 1 month ago

Open mpv through cmd and see if there are any errors.

[input] No key binding found for key 'F12'. [input] No key binding found for key 'F12'. [input] No key binding found for key 'F12'. [input] No key binding found for key 'F12'.

oltodosel commented 1 month ago

See if there are any errors before that. There should be, otherwise the script would work.

Rickyrvxlovet commented 1 month ago

See if there are any errors before that. There should be, otherwise the script would work.

Found it.

[total_playtime] [total_playtime] stack traceback: [total_playtime] C:/mpv/portable_config/scripts/total_playtime.lua:14: in main chunk [total_playtime] [C]: at 0x7ff74f8d97a0 [total_playtime] [C]: at 0x7ff74f8d85f0 [total_playtime] Lua error: C:/mpv/portable_config/scripts/total_playtime.lua:14: bad argument #2 to 'gsub' (string/function/table expected)

oltodosel commented 1 month ago

[saved_probed_filename = '~/.config/mpv/scripts/total_playtime.list'](https://github.com/oltodosel/mpv-scripts/blob/8fe23a2ed32f64edeb8a3690def122c3dab60583/total_playtime.lua#L8)

Change this line to windows-like appropriate path.

Rickyrvxlovet commented 1 month ago

[saved_probed_filename = '~/.config/mpv/scripts/total_playtime.list'](

https://github.com/oltodosel/mpv-scripts/blob/8fe23a2ed32f64edeb8a3690def122c3dab60583/total_playtime.lua#L8

) Change this line to windows-like appropriate path.

My problem was the same as this issue #1

I fixed it thanks to him Kayizoku

I was able to do it now. I had to set the os.getenv(''HOME') ---> os.getenv('APPDATA') for it to be able to calculate and log it. Thank you for your help. Its working now