1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 08:25:02 -04:00
filebot/BuildData.groovy
Reinhard Pointner 806ffdc91d * performance improvements / switch to series.list.gz
* use before-rule when cleaning up tokens from movie filenames
* added series.list.gz script
2012-02-23 18:48:35 +00:00

23 lines
866 B
Groovy

def page = new URL('http://thetvdb.com/?string=&searchseriesid=&tab=listseries&function=Search')
def names = page.fetch().getHtml('utf-8')
.depthFirst().TABLE.find{it['@id'] == "listtable"}
.depthFirst().TR.findAll{ it.TD.size() == 3 && it.TD[1].text() == 'English'}
.findResults{ it.TD[0].A.text() }
def anime = net.sourceforge.filebot.WebServices.AniDB.getAnimeTitles()
names += anime.findResults{ it.getPrimaryTitle() }
names += anime.findResults{ it.getOfficialTitle('en') }
names = names.findAll{ it =~ /^[A-Z]/ && it =~ /[\p{Alpha}]{3}/}.findResults{ net.sourceforge.filebot.similarity.Normalization.normalizePunctuation(it) }
names = names.sort().unique()
args[0].withOutputStream{ out ->
new java.util.zip.GZIPOutputStream(out).withWriter('utf-8'){ writer ->
names.each{ writer.append(it).append('\n') }
}
}
println "Series Count: " + names.size()