Skip to content

Instantly share code, notes, and snippets.

@kelciour
Last active February 23, 2024 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kelciour/caa2e035565d2c8609af915fb07d1336 to your computer and use it in GitHub Desktop.
Save kelciour/caa2e035565d2c8609af915fb07d1336 to your computer and use it in GitHub Desktop.
Watch Foreign Language Movies with Anki
* 2018-08-11
Initial release.
* 2018-09-27
Add a couple of experimental Anki shortcuts that can be used to adjust audio while reviewing cards in Anki.
`,` – subtract 0.25 ms. from the current start time
`.` – add 0.25 ms. to the current start time
`< (Shift+,)` – subtract 0.25 ms. from the current end time
`> (Shift+.)` – add 0.25 ms. to the current end time
`Ctrl+Shift+,` – set the start time to default
`Ctrl+Shift+.` – set the end time to default
* 2018-09-29
Add new options in the add-on configuration file (Anki -> Tools -> Add-ons... -> Open Add-ons Folder... -> movies2anki -> config.ini).
It's not necessary to restart Anki to apply new configuration options, but movies2anki must be closed before updating this file, i.e. close movies2anki -> edit config.ini -> restart movies2anki.
`join_lines_that_end_with = \\.\\.\\. , \u2192 [\u4e00-\u9fef]` – space-separated list of possible line endings (regular expressions) to be joined with the next line. By default, it's ... , → [\u4E00-\u9FEF].
`join_lines_separator = _` – how multiple lines are joined into one sentence. By default, it's space, but in config.ini it's written as _.
`join_sentences_separator = <br>` – how multiple sentences joined into one phrase. By default, it's new line and by replacing it with _ it can be changed to space.
`join_questions_with_answers = True` – join question sentences with the next sentence or not.
* 2018-10-04
Add `Shift+R` shortcut for continuous (i.e. without end) video playback.
Add `[` shortcut to replay the previous card and the current card.
Add `]` shortcut to replay the current card and the next card.
Add `Shift+[` shortcut to join the current card with the previous card (and remove the previous card).
Add `Shift+]` shortcut to join the current card with the next card (and remove the next card).
To batch process video files just put `*` (or `?`) in video and subtitles filename (i.e. there's no need to add {##/start_number} in the deck name).
* 2018-10-10
Add experimental new option "Generate Mobile Cards..." in the Tools menu to generate audio and video clips and review cards on AnkiMobile or AnkiDroid.
If there were any changes to the cards, for example, after joining two cards or updating the start or the end of the card, please use this option again to generate all missing audio and video files. And after that maybe Tools - Check Media... to clean up your collection.media folder.
* 2018-10-14
Add basic subs2srs card template ("movies2anki - subs2srs"). It can be selected instead of "movies2anki (add-on)" card template. It may take a couple of minutes to generate pictures for cards.
* 2018-10-15
Add experimental [IINA](https://lhc70000.github.io/iina/) support for macOS. Please use the latest release on https://github.com/lhc70000/iina/releases page.
* 2018-10-17
Add experimental "movies2anki - subs2srs (video)" card template. It's the same as "movies2anki - subs2srs". The only difference is that it plays video on the front side of the card instead of audio in Anki 2.0 and snapshots are generated using the start time of the card.
* 2019-01-02
Add support for [crop.lua](https://github.com/occivink/mpv-scripts) script [https://streamable.com/ybf50](https://streamable.com/ybf50).
* 2019-11-19
Add "movies2anki - subs2srs (audio)" card template that contains only audio and no shapshots.
Add audio normalization for "Generate Mobile Cards" using loudnorm FFmpeg filter in two-pass mode (video and audio) and mp3gain (audio only). It's disabled by default. If mp3gain is not found in the PATH, loudnorm will be used. These settings can be found in "player​.py" in the add-on's folder.
`NORMALIZE_AUDIO = False`
`NORMALIZE_AUDIO_FILTER = "I=-18:LRA=11"`
`NORMALIZE_AUDIO_WITH_MP3GAIN = True`
* 2019-11-20
Most of the options added in 2018 since the initial add-on release were requested and supported by a fellow Anki user. It was very welcome and much appreciated. Thank you.
The add-on for Anki 2.0 was downloaded 310 times since 2018-08-11.
* 2019-11-21
Add initial support for Anki 2.1. It's been tested on Windows 7 and Ubuntu. It might work on macOS out-of-the-box without installing mpv using brew, but it's still necessary to install FFmpeg using brew to generate mobile cards or snapshots for subs2srs card template.
* 2019-11-22
Update "movies2anki (subs2srs - video)" card template for Anki 2.1 to use HTML5 Video on mobile.
* 2019-11-24
Add a fix for macOS. A huge thanks to a fellow Anki user who notified me that the add-on didn't work on macOS and helped to resolve it in no time!
* 2019-11-30
Remove audio stream selection from the add-on window.
* 2019-12-01
Fix progress window getting stuck and app crash on Windows 10 x64.
* 2019-12-05
Select the last audio stream with Generate Mobile Cards.
* 2019-12-06
Update card template styling.
* 2019-12-08
Change default settings.
* 2019-12-09
Add an option not to join lines into sentences.
* 2019-12-15
Fix parsing and an encoding issue with subtitles.
* 2019-12-16
Fix "Invalid HTML on card" error.
* 2019-12-18
Ignore empty subtitles.
* 2019-12-20
Fix to find mpv on macOS.
---
2020-01-13 Update for Anki 2.1.17+
2020-02-22 Update for Anki 2.1.20+
2020-03-25 Fix no video on Windows with mpv 0.32
2020-03-26 Skip incorrect notes on generate mobile cards
2020-04-01 Fix to fully show all subs2srs model names
2020-04-23 Fix no video on Windows with mpv 0.32
2020-04-26 Add basic support for WebVTT (.vtt) subtitles
2020-04-27 Support standalone mpv bulds on macOS
2020-04-27 Try to use vlc on macOS if mpv isn't found
2020-04-29 Fix to try to use mpv bundled with Anki on macOS
2020-05-04 Keep only one snapshot while joining two notes
2020-05-23 Fix for Anki 2.1.26
2020-05-24 Ignore some ASS tags
2020-05-29 Choose the audio track selected by mpv for mobile cards
2020-06-04 Add export condensed audio
2020-06-09 Fix playing the video instead of the audio
2020-06-17 Fix local variable referenced before assignment
2020-06-23 Detect subtitles encoding with chardet
2020-06-28 Update the Id field if the Audio field had been changed with "." or "," shortcuts
2020-06-29 Fix UnicodeEncodeError with condensed audio export
2020-07-07 Fix audio on click not working (MIA Japanese)
2020-07-20 Fix tracks count parsing while generating mobile cards
2020-07-22 Add "audio fade in/out" in the config file (0.25 seconds by default)
2020-08-06 Fix condensed audio file got cut (not fully exported)
2020-08-08 Remove fade in filter to fix no audio on Windows
2020-08-08 Sort filenames in batch mode
2020-10-08 Use pysubs2 for parsing subtitle files
2020-10-08 Support .ass subtitles
2020-10-14 Fix to ignore subtitles with tags only
2021-04-19 Add /opt/homebrew/bin for Apple Silicon
2021-04-24 Raise exception if returncode is not zero
2021-05-13 Fix progress bar stops at 0%
2021-05-14 Add logging to debug "progress bar stops at 0%"
2021-05-14 If mpv fails after 5 seconds, try to select last audio stream with ffprobe
2021-05-19 Sort subtitles time-wise
2021-05-23 Add config option to save video clips as webm
2021-06-30 Fix split_long_phrases IndexError: list index out of range
2022-11-10 Show why ffprobe can't find any audio streams
2022-11-12 Revert 2022-11-10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment