Skip to content

Instantly share code, notes, and snippets.

@rednoah
Last active May 27, 2016 15:05
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 rednoah/3e127426fb35f86b77a679372fa05a24 to your computer and use it in GitHub Desktop.
Save rednoah/3e127426fb35f86b77a679372fa05a24 to your computer and use it in GitHub Desktop.
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