Ashyni / mpv-scripts

dynamic-crop.lua script for mpv player/lib.
MIT License
81 stars 4 forks source link

Doesn't work with the YouTube playlist URL #18

Closed U1s2e3r4n5a6m7e closed 1 year ago

U1s2e3r4n5a6m7e commented 1 year ago

Setup (please complete the following information):

Additional context No additional mpv configuration.

Describe the bug It works with local files. It works with YouTube video URLs. It works with the m3u files that contain YouTube URLs.

But it doesn't work with the YouTube playlist URL.

Example: https://www.youtube.com/playlist?list=PLWtysTkuEQDPfEJtInFvAU7zgMiYLXSRq

[dynamic_crop]
[dynamic_crop] stack traceback:
[dynamic_crop]  /home/user/.config/mpv/scripts/dynamic-crop.lua:733: in function 'handler'
[dynamic_crop]  mp.defaults:510: in function 'call_event_handlers'
[dynamic_crop]  mp.defaults:552: in function 'dispatch_events'
[dynamic_crop]  mp.defaults:503: in function <mp.defaults:502>
[dynamic_crop]  [C]: at 0x558d230d75e0
[dynamic_crop]  [C]: at 0x558d230d7aa0
[dynamic_crop] Lua error: /home/user/.config/mpv/scripts/dynamic-crop.lua:157: attempt to index field 'stats' (a nil value)
Playing: https://www.youtube.com/watch?v=6Ejga4kJUts
 (+) Video --vid=1 (*) (vp9 3840x2160 24.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
U1s2e3r4n5a6m7e commented 1 year ago

Thank you! I always love using this script; it's a real lifesaver!