Merge pull request #462 from midoks/dev

网站统计-其他爬虫识别优化
This commit is contained in:
Mr Chen
2023-09-27 18:41:19 +08:00
committed by GitHub
5 changed files with 15 additions and 9 deletions
+11 -5
View File
@@ -890,15 +890,21 @@ function _M.match_spider(self, ua)
end
-- Curl|Yahoo|HeadlessChrome|包含bot|Wget|Spider|Crawler|Scrapy|zgrab|python|java|Adsbot|DuckDuckGo
find_spider, _ = ngx.re.match(ua, "(Yahoo|Slurp|DuckDuckGo)", "ijo")
if res then
find_spider, _ = ngx.re.match(ua, "(Yahoo|Slurp|DuckDuckGo|Semrush|Spider|Bot)", "ijo")
if find_spider then
spider_match = string.lower(find_spider[0])
if string.find(spider_match, "yahoo", 1, true) then
spider_name = "yahoo"
spider_name = "other"
elseif string.find(spider_match, "slurp", 1, true) then
spider_name = "yahoo"
spider_name = "other"
elseif string.find(spider_match, "duckduckgo", 1, true) then
spider_name = "duckduckgo"
spider_name = "other"
elseif string.find(spider_match, "semrush", 1, true) then
spider_name = "other"
elseif string.find(spider_match, "spider", 1, true) then
spider_name = "other"
elseif string.find(spider_match, "bot", 1, true) then
spider_name = "other"
end
return true, spider_name, spider_table[spider_name]
end
+1 -1
View File
@@ -28,7 +28,7 @@ elif grep -Eqi "openSUSE" /etc/*-release; then
zypper install cron wget curl zip unzip
elif grep -Eqi "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eq "EulerOS" /etc/*-release || grep -Eq "openEuler" /etc/*-release; then
elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then
OSNAME='euler'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
+1 -1
View File
@@ -32,7 +32,7 @@ elif grep -Eq "openSUSE" /etc/*-release; then
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eq "EulerOS" /etc/*-release || grep -Eq "openEuler" /etc/*-release; then
elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then
OSNAME='euler'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
+1 -1
View File
@@ -25,7 +25,7 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "EulerOS" /etc/*-release || grep -Eq "openEuler" /etc/*-release; then
elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then
OSNAME='euler'
elif grep -Eqi "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
+1 -1
View File
@@ -25,7 +25,7 @@ if [ ${_os} == "Darwin" ]; then
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "EulerOS" /etc/*-release || grep -Eq "openEuler" /etc/*-release; then
elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then
OSNAME='euler'
elif grep -Eqi "FreeBSD" /etc/*-release; then
OSNAME='freebsd'