mirror of
https://github.com/privacy-protection-tools/anti-AD.git
synced 2025-02-13 17:12:41 +08:00
update summary info
This commit is contained in:
parent
60a36ab986
commit
f9468d3adf
@ -1,6 +1,7 @@
|
|||||||
#VER=20200211100531
|
#TITLE=anti-AD
|
||||||
|
#VER=20200213025631
|
||||||
#URL=https://github.com/privacy-protection-tools/anti-AD
|
#URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
#TOTAL_COUNT=31352
|
#TOTAL_LINES=31352
|
||||||
address=/0024aaaa.com/
|
address=/0024aaaa.com/
|
||||||
address=/0026645142c89aeb1.com/
|
address=/0026645142c89aeb1.com/
|
||||||
address=/003store.com/
|
address=/003store.com/
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#VER=20200211100532
|
#TITLE=anti-AD
|
||||||
|
#VER=20200213025631
|
||||||
#URL=https://github.com/privacy-protection-tools/anti-AD
|
#URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
#TOTAL_COUNT=35807
|
#TOTAL_LINES=35807
|
||||||
0024aaaa.com
|
0024aaaa.com
|
||||||
0026645142c89aeb1.com
|
0026645142c89aeb1.com
|
||||||
003store.com
|
003store.com
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
!AdBlock-style blocklists
|
!TITLE=anti-AD
|
||||||
!VER=20200213014222
|
!VER=20200213025631
|
||||||
!URL=https://github.com/privacy-protection-tools/anti-AD
|
!URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
|
!TOTAL_LINES=30092
|
||||||
||201*.myhard.com^
|
||201*.myhard.com^
|
||||||
||8*.tianya.cn^
|
||8*.tianya.cn^
|
||||||
||a*.chajiaotong.com^
|
||a*.chajiaotong.com^
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#VER=20200211100532
|
#TITLE=anti-AD
|
||||||
|
#VER=20200213025631
|
||||||
#URL=https://github.com/privacy-protection-tools/anti-AD
|
#URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
#TOTAL_COUNT=31352
|
#TOTAL_LINES=31352
|
||||||
DOMAIN-SUFFIX,0024aaaa.com
|
DOMAIN-SUFFIX,0024aaaa.com
|
||||||
DOMAIN-SUFFIX,0026645142c89aeb1.com
|
DOMAIN-SUFFIX,0026645142c89aeb1.com
|
||||||
DOMAIN-SUFFIX,003store.com
|
DOMAIN-SUFFIX,003store.com
|
||||||
|
@ -11,7 +11,7 @@ class writerFormat{
|
|||||||
/*dnsmasq支持格式的屏蔽广告列表*/
|
/*dnsmasq支持格式的屏蔽广告列表*/
|
||||||
const DNSMASQ = array(
|
const DNSMASQ = array(
|
||||||
'format' => 'address=/{DOMAIN}/',
|
'format' => 'address=/{DOMAIN}/',
|
||||||
'header' => "#VER={DATE}\n#URL={URL}\n#TOTAL_COUNT={COUNT}\n",
|
'header' => "#TITLE=anti-AD\n#VER={DATE}\n#URL={URL}\n#TOTAL_LINES={COUNT}\n",
|
||||||
'full_domain' => 0,
|
'full_domain' => 0,
|
||||||
'name' => 'dnsmasq',
|
'name' => 'dnsmasq',
|
||||||
'filename' => 'adblock-for-dnsmasq.conf',
|
'filename' => 'adblock-for-dnsmasq.conf',
|
||||||
@ -39,7 +39,7 @@ class writerFormat{
|
|||||||
/*easylist 兼容格式的屏蔽广告列表*/
|
/*easylist 兼容格式的屏蔽广告列表*/
|
||||||
const EASYLIST = array(
|
const EASYLIST = array(
|
||||||
'format' => '||{DOMAIN}^',
|
'format' => '||{DOMAIN}^',
|
||||||
'header' => "!AdBlock-style blocklists\n!VER={DATE}\n!URL={URL}\n",
|
'header' => "!TITLE=anti-AD\n!VER={DATE}\n!URL={URL}\n!TOTAL_LINES=00000\n",
|
||||||
'full_domain' => 0,
|
'full_domain' => 0,
|
||||||
'name' => 'easylist',
|
'name' => 'easylist',
|
||||||
'filename' => 'anti-ad-easylist.txt',
|
'filename' => 'anti-ad-easylist.txt',
|
||||||
@ -67,7 +67,7 @@ class writerFormat{
|
|||||||
/*Surge 兼容格式的屏蔽广告列表*/
|
/*Surge 兼容格式的屏蔽广告列表*/
|
||||||
const SURGE = array(
|
const SURGE = array(
|
||||||
'format' => 'DOMAIN-SUFFIX,{DOMAIN}',
|
'format' => 'DOMAIN-SUFFIX,{DOMAIN}',
|
||||||
'header' => "#VER={DATE}\n#URL={URL}\n#TOTAL_COUNT={COUNT}\n",
|
'header' => "#TITLE=anti-AD\n#VER={DATE}\n#URL={URL}\n#TOTAL_LINES={COUNT}\n",
|
||||||
'full_domain' => 0,
|
'full_domain' => 0,
|
||||||
'name' => 'surge',
|
'name' => 'surge',
|
||||||
'filename' => 'anti-ad-surge.txt',
|
'filename' => 'anti-ad-surge.txt',
|
||||||
@ -95,7 +95,7 @@ class writerFormat{
|
|||||||
/*Domains 格式的屏蔽广告列表,用于支持pi-hole等*/
|
/*Domains 格式的屏蔽广告列表,用于支持pi-hole等*/
|
||||||
const DOMAINS = array(
|
const DOMAINS = array(
|
||||||
'format' => '{DOMAIN}',
|
'format' => '{DOMAIN}',
|
||||||
'header' => "#VER={DATE}\n#URL={URL}\n#TOTAL_COUNT={COUNT}\n",
|
'header' => "#TITLE=anti-AD\n#VER={DATE}\n#URL={URL}\n#TOTAL_LINES={COUNT}\n",
|
||||||
'full_domain' => 1, //保留子域名,即使其上级域名
|
'full_domain' => 1, //保留子域名,即使其上级域名
|
||||||
'name' => 'domains',
|
'name' => 'domains',
|
||||||
'filename' => 'anti-ad-domains.txt',
|
'filename' => 'anti-ad-domains.txt',
|
||||||
|
@ -164,15 +164,19 @@ while(!feof($wild_fp)){
|
|||||||
fclose($wild_fp);
|
fclose($wild_fp);
|
||||||
|
|
||||||
$arr_wild_src = array_merge($arr_wild_src, $ARR_MERGED_WILD_LIST);
|
$arr_wild_src = array_merge($arr_wild_src, $ARR_MERGED_WILD_LIST);
|
||||||
|
$insert_pos = $written_size = $line_count = 0;
|
||||||
while(!feof($src_fp)){
|
while(!feof($src_fp)){
|
||||||
$row = fgets($src_fp, 512);
|
$row = fgets($src_fp, 512);
|
||||||
if(empty($row)){
|
if(empty($row)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(($row{0} === '!') && (substr($row, 0, 13) === '!TOTAL_LINES=')){
|
||||||
|
$insert_pos = $written_size;
|
||||||
|
}
|
||||||
|
|
||||||
if(!preg_match('/^\|.+?/', $row)){
|
if(!preg_match('/^\|.+?/', $row)){
|
||||||
fwrite($new_fp, $row);
|
$written_size += fwrite($new_fp, $row);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +185,8 @@ while(!feof($src_fp)){
|
|||||||
if(preg_match($regex_str, substr(trim($row), 2, -1))){
|
if(preg_match($regex_str, substr(trim($row), 2, -1))){
|
||||||
$matched = true;
|
$matched = true;
|
||||||
if(!array_key_exists($regex_str, $wrote_wild)){
|
if(!array_key_exists($regex_str, $wrote_wild)){
|
||||||
fwrite($new_fp, "${regex_str}\n");
|
$written_size += fwrite($new_fp, "${regex_str}\n");
|
||||||
|
$line_count++;
|
||||||
$wrote_wild[$regex_str] = 1;
|
$wrote_wild[$regex_str] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,7 +199,8 @@ while(!feof($src_fp)){
|
|||||||
foreach($arr_wild_src as $core_str => $wild_row){
|
foreach($arr_wild_src as $core_str => $wild_row){
|
||||||
$match_rule = str_replace('*', '.*', $core_str);
|
$match_rule = str_replace('*', '.*', $core_str);
|
||||||
if(!array_key_exists($core_str, $wrote_wild)){
|
if(!array_key_exists($core_str, $wrote_wild)){
|
||||||
fwrite($new_fp, "||${core_str}^\n");
|
$written_size += fwrite($new_fp, "||${core_str}^\n");
|
||||||
|
$line_count++;
|
||||||
$wrote_wild[$core_str] = 1;
|
$wrote_wild[$core_str] = 1;
|
||||||
}
|
}
|
||||||
if(preg_match("/\|${match_rule}/", $row)){
|
if(preg_match("/\|${match_rule}/", $row)){
|
||||||
@ -206,7 +212,8 @@ while(!feof($src_fp)){
|
|||||||
if($matched){
|
if($matched){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fwrite($new_fp, $row);
|
$written_size += fwrite($new_fp, $row);
|
||||||
|
$line_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//按需写入白名单规则
|
//按需写入白名单规则
|
||||||
@ -229,6 +236,7 @@ foreach($ARR_WHITE_RULE_LIST as $row => $v){
|
|||||||
if($v === 1){
|
if($v === 1){
|
||||||
$wrote_whitelist[$matches[1]] = null;
|
$wrote_whitelist[$matches[1]] = null;
|
||||||
fwrite($new_fp, "@@||${matches[1]}^\n");
|
fwrite($new_fp, "@@||${matches[1]}^\n");
|
||||||
|
$line_count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,10 +259,15 @@ foreach($ARR_WHITE_RULE_LIST as $row => $v){
|
|||||||
}
|
}
|
||||||
$wrote_whitelist[$matches[1]] = null;
|
$wrote_whitelist[$matches[1]] = null;
|
||||||
fwrite($new_fp, "@@||${matches[1]}^\n");
|
fwrite($new_fp, "@@||${matches[1]}^\n");
|
||||||
|
$line_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(($insert_pos > 0) && (fseek($new_fp, $insert_pos) === 0)){
|
||||||
|
fwrite($new_fp, "!TOTAL_LINES={$line_count}\n");
|
||||||
|
}
|
||||||
|
|
||||||
fclose($src_fp);
|
fclose($src_fp);
|
||||||
fclose($new_fp);
|
fclose($new_fp);
|
||||||
rename($src_file . '.txt', $src_file);
|
rename($src_file . '.txt', $src_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user