daily pastebin goal
0%
SHARE
TWEET

subtitles.groovy

a guest Oct 30th, 2013 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def osdb = net.sourceforge.filebot.WebServices.OpenSubtitles
  2.  
  3. console.print('Enter Show Name: ')
  4. def query = console.readLine()
  5. def language = 'English'
  6.  
  7. def options = osdb.search(query)
  8. println "Fetching subtitles for '${options[0]}'"
  9.  
  10.  
  11. def subs = osdb.getSubtitleList(options[0], language)
  12. println "Found ${subs.size()} subtitles"
  13.  
  14. def selection = subs.findAll{ it.languageName =~ language && parseEpisodeNumber(it.name) != null }.groupBy{ parseEpisodeNumber(it.name) }.values()*.get(0)
  15. println "Selected ${selection.size()} subtitles"
  16.  
  17. selection.each{
  18.         println it.fetch().saveAs(it.path)
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top