diff --git a/src/Animarr/AniDB.php b/src/Animarr/AniDB.php index 191f597..c6c6cc7 100644 --- a/src/Animarr/AniDB.php +++ b/src/Animarr/AniDB.php @@ -221,8 +221,8 @@ class AniDB{ } private function initCache($path, $force = false){ - if($force !== null and ($force or !file_exists($path) or filemtime($path) < (time() - 3600 * 36))){ //Download every 36 hours - $contents = file_get_contents(Database::getConfigKey("anidb.titles.url", "http://anidb.net/api/anime-titles.dat.gz")); + if($force !== null and ($force or !file_exists($path) or filesize($path) < 4096 or filemtime($path) < (time() - 3600 * 36))){ //Download every 36 hours + $contents = Request::getURL(Database::getConfigKey("anidb.titles.url", "https://anidb.net/api/anime-titles.dat.gz")); if(strlen($contents) > 4096){ file_put_contents($path, zlib_decode($contents)); }