daily pastebin goal
39%
SHARE
TWEET

Fetch Each Episode Subtitle

filebot Oct 25th, 2013 256 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def osdb = net.sourceforge.filebot.WebServices.OpenSubtitles
  2.  
  3. def query = 'firefly'
  4. def language = 'English'
  5.  
  6. def options = osdb.search(query)
  7. println "Fetching subtitles for '${options[0]}'"
  8.  
  9.  
  10. def subs = osdb.getSubtitleList(options[0], language)
  11. println "Found ${subs.size()} subtitles"
  12.  
  13. def selection = subs.findAll{ it.languageName =~ language && parseEpisodeNumber(it.name) != null }.groupBy{ parseEpisodeNumber(it.name) }.values()*.get(0)
  14. println "Selected ${selection.size()} subtitles"
  15.  
  16. selection.each{
  17.         println it.fetch().saveAs(it.path)
  18. }
RAW Paste Data
Top