Update webstats_common.lua

pull/624/head
Mr Chen 9 months ago
parent 7464789c8c
commit 0f27552817
  1. 4
      plugins/webstats/lua/webstats_common.lua

@ -945,7 +945,7 @@ 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|Semrush|Spider|Bot)", "ijo")
find_spider, _ = ngx.re.match(ua, "(Yahoo|Slurp|DuckDuckGo|Semrush|Spider|Bot|crawler)", "ijo")
if find_spider then
spider_match = string.lower(find_spider[0])
if string.find(spider_match, "yahoo", 1, true) then
@ -960,6 +960,8 @@ function _M.match_spider(self, ua)
spider_name = "other"
elseif string.find(spider_match, "bot", 1, true) then
spider_name = "other"
elseif string.find(spider_match, "crawler", 1, true) then
spider_name = "other"
end
return true, spider_name, spider_table[spider_name]
end

Loading…
Cancel
Save