Ben-Kerman / immersive

Language learning mpv script for looking up words within mpv and generating Anki cards
GNU General Public License v3.0
81 stars 1 forks source link

Error: attempt to perform arithmetic on field 'start' (a nil value) when trying to export #4

Closed pndyjack closed 3 years ago

pndyjack commented 3 years ago

mpv_aW1fWqgXCk

Steps to reproduce

  1. This video file, downloaded
  2. Subs file added with a delay of +5000ms
  3. Input - Ctrl+a
  4. Input - K
  5. Select word
  6. Input - Enter, no definitions found
  7. Input - f
Ben-Kerman commented 3 years ago

I can't reproduce, and I don't know how it could happen either unless the subtitle line doesn't have a start time for some reason. Are you using 1.1 or the latest commit? Does this happen consistently and with different lines as well?

Could you send me the subtitle file?

pndyjack commented 3 years ago

Yes, I'm using 1.1. I tried with another line with a target word that has a definition, and got the same error. Here's the subtitle file

Ben-Kerman commented 3 years ago

It's an issue with the subs. The last line has an invalid end time (00:00:00,000), which causes mpv to return nil/null for all sub start/end times (no idea why, probably a bug in mpv). If you edit the last sub so its end time is after its start time it should work again

Ben-Kerman commented 3 years ago

I added a warning with 675470c, that should be enough for now unless it becomes a frequent problem