From b03c052705f2cd1c4fd66a2d3b839011f6f98e68 Mon Sep 17 00:00:00 2001 From: zu1k Date: Fri, 17 Jun 2022 13:19:53 +0800 Subject: [PATCH] Add qqwry update notice Signed-off-by: zu1k --- go.mod | 2 +- go.sum | 2 ++ pkg/common/httpclient.go | 2 +- pkg/qqwry/update.go | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 2c62475..cef3f5e 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.0 // indirect github.com/ulikunitz/xz v0.5.10 // indirect - golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68 // indirect + golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect golang.org/x/tools v0.1.7 // indirect gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 2f3a4bb..154f3ec 100644 --- a/go.sum +++ b/go.sum @@ -355,6 +355,8 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAgl golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68 h1:z8Hj/bl9cOV2grsOpEaQFUaly0JWN3i97mo3jXKJNp0= golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/pkg/common/httpclient.go b/pkg/common/httpclient.go index 9275114..b869746 100644 --- a/pkg/common/httpclient.go +++ b/pkg/common/httpclient.go @@ -6,7 +6,7 @@ import ( "time" ) -const UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36" +const UserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36" type HttpClient struct { *http.Client diff --git a/pkg/qqwry/update.go b/pkg/qqwry/update.go index 41d51b4..48cc538 100644 --- a/pkg/qqwry/update.go +++ b/pkg/qqwry/update.go @@ -4,6 +4,7 @@ import ( "bytes" "compress/zlib" "encoding/binary" + "fmt" "io/ioutil" "log" @@ -11,6 +12,8 @@ import ( ) func Download(filePath ...string) (data []byte, err error) { + fmt.Println("此方式更新的 QQWry 数据库版本过旧,请手动下载最新版纯真免费IP库: https://www.cz88.net/help") + data, err = downloadAndDecrypt() if err != nil { log.Printf("纯真IP库下载失败,请手动下载解压后保存到本地: %s \n", filePath)