cdroller
альтернативный способ, прост пхп скриптом чекать по крону
<?php
error_reporting(255);
ini_set("max_execution_time", "180");
/* SmartThumbs Patch */
$smartpath = '/var/www/admin/data/www/xxx.com/st/';
/* Text for Search */
$search = array('This video was deleted', 'This movie has been removed', 'We are sorry but the video is no longer available', 'The file you have requested was not found on this server', 'This video cannot be found');
/* Delete 301,302,303 Redirect and 404 Page Not Found (1 -ON) */
$Redirect = 0;
$E404 = 0;
/* Do Not Search URL */
$xblack = array('out.cgi', 'www.hostave', 'free.');
/* Useragent, Referer and Languges for parsing */
$ref = "http://www.google.com/";
$userag = "Mozilla/5.0 (Windows; U; Windows NT 5.1; ca; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4 (.NET CLR 3.5.30729)";
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n"
)
);
//*******************************************************************
include_once($smartpath.'classes/mysql.php');
$hostname = $mysql['db_host'];
$dbname = $mysql['db_name'];
$dbuser = $mysql['db_user'];
$dbpass = $mysql['db_password'];
MYSQL_CONNECT($hostname, $dbuser, $dbpass) OR DIE("Unable to connect to database");
@mysql_select_db($dbname) or die("Unable to select database");
$d_table = mysql_query("SELECT * FROM st_galleries;");
while ($stroka = mysql_fetch_array($d_table)) {
set_time_limit(0);
$testurl = $stroka["url"];
$blackfound = 0;
foreach($xblack as $black) {
$black = '/'.$black.'/';
if (preg_match($black, $testurl)) $blackfound = 1;
}
if ($blackfound == 0) {
$context = stream_context_create($opts);
$ch = curl_init($testurl);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $userag);
curl_setopt($ch, CURLOPT_REFERER, $ref);
$file = curl_exec($ch);
$data = curl_exec($ch);
$info = curl_getinfo($ch);
$http_code = $info['http_code'];
curl_close($ch);
if ($Redirect == 1 && ($http_code == 301 || $http_code == 302 || $http_code == 303)) $result[] = $testurl;
if ($E404 == 1 && $http_code == 404) $result[] = $testurl;
if ($http_code == 200) {
foreach($search as $key) {
$key = '/'.$key.'/';
if (preg_match ($key, $file)) {
$result[] = $testurl;
}
}
}
}
}
foreach ($result as $url) {
if (empty($url)) { continue; }
$sql = "SELECT * FROM st_galleries WHERE url='$url'";
$mainres = mysql_query($sql);
$number = MYSQL_NUMROWS($mainres);
if ($number>0) {
$galrow = mysql_fetch_array($mainres);
do {
$id = $galrow['ID'];
MYSQL_QUERY("UPDATE st_galleries_1
SET
enabled='0',
active='0',
text_active='0'
WHERE ID='$id'");
} while ($galrow = mysql_fetch_array($mainres));
}
MYSQL_QUERY("UPDATE st_galleries
SET
'delete'='1'
WHERE url='$url'");
}
MYSQL_CLOSE();
?>
скрипт по мере чека, переводит ломаные гали в режим disabled, можно не только на ошибки чекать но и проверять контент, искать фразы об его удалении, актуально для тубов ... в общем то доделать и переделать не проблема, если нужно както по другому чекать ... в .htaccess запретить доступ к файлу со скриптом с любых IP, кроме localhost