修复bug,提升性能

This commit is contained in:
gently 2018-10-08 10:59:06 +08:00
parent 26893d2a49
commit d0f8adb562
5 changed files with 457 additions and 492 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ return array( 'cnzz.com' => array('.cnzz.com'),
'wrating.com' => array('.wrating.com', 'wrating.com'),
'umengcloud.com' => array('.umengcloud.com', 'umengcloud.com'),
'umeng.com' => array('.umeng.com', 'umeng.com'),
'umeng.com' => array('.umeng.co', 'umeng.co'),
'umeng.co' => array('.umeng.co', 'umeng.co'),
'msn.com' => array('.msn.com', 'msn.com'),
'qbao.com' => array('.qbao.com'), //钱宝网
'dftoutiao.com' => array('.dftoutiao.com'),

File diff suppressed because one or more lines are too long

View File

@ -31,6 +31,9 @@ echo '开始下载host2....',"\n";
$host2 = makeAddr::http_get('http://www.malwaredomainlist.com/hostslist/hosts.txt');
$arr_result = array_merge_recursive($arr_result, makeAddr::get_domain_list($host2));
$arr_result = array_merge($arr_result, $arr_blacklist);
echo '写入文件大小:';
var_dump(makeAddr::write_to_conf($arr_result, './adblock-for-dnsmasq.conf'));
@ -114,7 +117,6 @@ class makeAddr{
}
}
$arr_domains = array_merge($arr_domains, $GLOBALS['arr_blacklist']);
return $arr_domains;
}
@ -151,7 +153,6 @@ class makeAddr{
$arr_domains[self::extract_main_domain($row[1])][] = $row[1];
}
$arr_domains = array_merge($arr_domains, $GLOBALS['arr_blacklist']);
return $arr_domains;
}
@ -179,16 +180,13 @@ class makeAddr{
$rv = array_unique($rv);
$rk_found = false;
if(in_array('.' . $rk, $rv)){
if(in_array('.' . $rk, $rv) || in_array('www.' . $rk, $rv)){
$write_len += fwrite($fp, 'address=/.' . $rk . '/127.0.0.1' . "\n");
$rk_found = true;
continue;
}
foreach($rv as $rvv){
if(!$rk_found || (strpos($rvv, '.' . $rk) === false)){
$write_len += fwrite($fp, 'address=/' . $rvv . '/127.0.0.1' . "\n");
}
}
}

View File

@ -2,7 +2,9 @@
source /etc/profile
cd $(dirname $(readlink -f "$0"))
cd $(cd "$(dirname "$0")";pwd)
echo pwd is: `pwd`
echo '开始下载 easylist1...'
wget -O easylistchina+easylist.txt https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt