Created
November 26, 2014 21:09
-
-
Save tokkenno/0523a7cb954b88f7ab35 to your computer and use it in GitHub Desktop.
Script de aegisub (http://www.aegisub.org/) que limpia el error que inserta strings ABC en los subtitulos .ass al demultiplexar desde Matroska (.mkv) archivos viejos.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local tr = aegisub.gettext | |
| script_name = tr"Clean ABC Error" | |
| script_description = tr"Clean ABC error created when demux .mkv files." | |
| script_author = "Aitor González" | |
| script_version = "0.1" | |
| script_modified = "18/11/2012" | |
| function clean_abc(subtitles) | |
| startvar = 1 | |
| endvar = false | |
| list_l = {} | |
| while endvar ~= true do | |
| for i = startvar, #subtitles do | |
| aegisub.progress.set(i * 100 / #subtitles) | |
| if subtitles[i].class == "dialogue" and not subtitles[i].comment and subtitles[i].text == "ABC" then | |
| table.insert(list_l, i) | |
| end | |
| if i == #subtitles then | |
| endvar = true | |
| end | |
| if table.getn(list_l) == 200 then | |
| startvar = i - 200 | |
| break | |
| end | |
| end | |
| subtitles.delete(unpack(list_l)) | |
| list_l = {} | |
| end | |
| end | |
| function clean_abc_macro(subtitles, selected_lines, active_line) | |
| clean_abc(subtitles) | |
| aegisub.set_undo_point(script_name) | |
| end | |
| function clean_abc_filter(subtitles, config) | |
| clean_abc(subtitles) | |
| end | |
| aegisub.register_macro(script_name, script_description, clean_abc_macro) | |
| aegisub.register_filter(script_name, script_description, 0, clean_abc_filter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment