To @kelcior: movies2anki creates only one card for these

https://www.youtube.com/watch?v=EgSNqTI3pHY downloaded with youtube-dl, German subtitles, VTT, cause an error:

Caught exception:
Traceback (most recent call last):
  File "/home/fc/.local/share/Anki2/addons21/939347702/movies2anki.py", line 1515, in start
    self.startSingleMode()
  File "/home/fc/.local/share/Anki2/addons21/939347702/movies2anki.py", line 1628, in startSingleMode
    self.model.create_subtitles()
  File "/home/fc/.local/share/Anki2/addons21/939347702/movies2anki.py", line 905, in create_subtitles
    en_subs = self.load_subtitle(self.en_srt, self.is_ignore_sdh_subtitle, self.join_lines_separator, self.join_sentences_separator, self.is_gap_phrases)
  File "/home/fc/.local/share/Anki2/addons21/939347702/movies2anki.py", line 701, in load_subtitle
    return read_subtitles(file_content, is_ignore_SDH, join_lines_separator, join_sentences_separator, is_gap_phrases)
  File "/home/fc/.local/share/Anki2/addons21/939347702/movies2anki.py", line 188, in read_subtitles
    sub_end = srt_time_to_seconds(sub_timecode[1].strip())
  File "/home/fc/.local/share/Anki2/addons21/939347702/movies2anki.py", line 124, in srt_time_to_seconds
    return int(major[0]) * 3600 + int(major[1]) * 60 + int(major[2]) + float(minor) / 1000
ValueError: could not convert string to float: '519 align:start position:0%'

If the subtitles are converted into SRT with youtube-dl’s --convert-subs=srt, movies2anki creates only one card with the whole subtitle text in the Express field and “002.Trinkst_du_deinen_Kaffee_richtig.EgSNqTI3pHYyoutube.by-maiLab_0.00.01.510-0.02.29.140” in the first one, no matter the Split Long Phrases, Gap or Movies vs Phrases options.

Thanks!

About vtt, I’ll look for a way to fix it sometime later.

About srt, currently there’a a bug, but if set “Gap Between Phrases” to 0 and uncheck it, everthing should be okay.

image

1 Like