Last active
May 27, 2016 15:05
-
-
Save rednoah/3e127426fb35f86b77a679372fa05a24 to your computer and use it in GitHub Desktop.
This file contains 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
def languages = _args.lang.split(/\W/) as List | |
// select input videos | |
def videoFiles = args.getFiles{ it.isVideo() } | |
// fetch missing subtitles | |
def subtitleFiles = languages.findResults{ | |
getMissingSubtitles(lang: it, file: videoFiles, output: 'srt', encoding: 'UTF-8') | |
}.flatten() | |
// rename subtitles | |
rename(map: subtitleFiles.collectEntries{ | |
[it, getMediaInfo(it, '{fn[0..-5]}.{lang.ISO3B}.{ext}')] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment