Apply 2020-04-03 patch for anidb titles over https
This commit is contained in:
parent
a94dee7269
commit
ce0ef46a0e
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue