ustuehler / bunkai Goto Github PK
View Code? Open in Web Editor NEWDecompose media content with subtitles into flash cards (e.g., for Anki)
License: MIT License
Decompose media content with subtitles into flash cards (e.g., for Anki)
License: MIT License
Anki is a flashcard program, and one of its add-ons does the same thing without being a screensaver:
https://ankiweb.net/shared/info/90397199
Please enjoy.
vvlaw@archlinux ~ go install github.com/ustuehler/bunkai@latest 1 ↵ 6961 11:09:15
go: downloading github.com/ustuehler/bunkai v0.0.0-20220418185131-553c0ab62e90
go: downloading github.com/spf13/cobra v1.1.3
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/spf13/viper v1.7.1
go: downloading github.com/asticode/go-astisub v0.12.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading github.com/magiconair/properties v1.8.1
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: downloading github.com/pelletier/go-toml v1.2.0
go: downloading github.com/spf13/afero v1.1.2
go: downloading github.com/spf13/cast v1.3.0
go: downloading github.com/spf13/jwalterweatherman v1.0.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading gopkg.in/ini.v1 v1.51.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
go: downloading golang.org/x/text v0.3.2
go: downloading golang.org/x/net v0.0.0-20200904194848-62affa334b73
go: downloading github.com/asticode/go-astikit v0.8.0
go: downloading github.com/asticode/go-astits v1.3.0
vvlaw@archlinux ~ bunkai ✔ 6961 11:09:49
zsh: command not found: bunkai
Thanks for Bunkai. It's an awesome tool!
In case of a MKV file, is there an option to point bunkai to the right audio track? MKV files can have many, and the first (i.e. the default one) isn't always the right choice for me.
Thanks!
Thanks a lot for the tool! substudy had some major pain points that ruined 80% of stuff I tried to extract (duplicate timestamps in .ass files extracted by ffmpeg). The thing I spend the most time on now is rewriting filenames.
Currently I'm rewriting each file as filename.mkv.jp.srt and then running:
ls -1 *.{mkv,avi,mp4} | parallel -j4 'ffmpeg -i {} {}.en.ass'
ls -1 *.{mp4,avi,mkv} | parallel -j16 'bunkai extract cards -m {} {}.jp.* {}.en.*'
It would be great to have some automation here. This could be done with NLP keyword extraction, I think. An example library that does this is retext-keywords or for golang RAKE. I also doubt these keyword extractors are good at picking out episode numbers though so they may need to be tweaked a bit. I've tried this kind of thing in the past using regex heuristics, but they get crazy and buggy due to edge cases. Maybe that's fine though.
Also, some pre-parsing is needed because brackets in filenames is breaking the sound field in anki. Escaping them in anki doesn't do anything and removing them causes anki to do a fuzzy search which can take 5+ seconds to find the file with large amounts of media. Almost always the stuff inside brackets is erroneous data that can be ignored. / *\[[^\]]*\] */g
Regex to remove everything within brackets, parens, and quotes:
/[ _\.\-]*(\[[^\]]*\]|\([^\)]*\)|'[^']*'|"[^"]*)[ _\-]*/g
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.