From af4b46413b69f61a19dea4df35bfb86c17f39322 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 10 Apr 2016 15:24:15 +0000 Subject: [PATCH] Cache html pages (in case build fails or is interrupted so we can quickly resume) --- build-data/BuildData.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build-data/BuildData.groovy b/build-data/BuildData.groovy index 361ddfef..f91aab71 100755 --- a/build-data/BuildData.groovy +++ b/build-data/BuildData.groovy @@ -248,7 +248,11 @@ tvdb_updates.values().each{ update -> } // scrape extra alias titles from webpage (not supported yet by API) - def jsoup = org.jsoup.Jsoup.connect("http://thetvdb.com/?tab=series&id=${update.id}").get() + def html = Cache.getCache('thetvdb_series_page', CacheType.Persistent).text(update.id) { + return new URL("http://thetvdb.com/?tab=series&id=${it}") + }.expire(Cache.ONE_MONTH).get() + + def jsoup = org.jsoup.Jsoup.parse(html) def akaseries = jsoup.select('#akaseries table tr table tr') .findAll{ it.select('td').any{ it.text() ==~ /en/ } } .findResults{ it.select('td').first().text() }