|
@@ -1,4 +1,5 @@
|
|
-/**
|
|
|
|
|
|
+/*
|
|
|
|
+*
|
|
GO代码相对简单,
|
|
GO代码相对简单,
|
|
重点处理下载工具,爬虫启动,监控等。
|
|
重点处理下载工具,爬虫启动,监控等。
|
|
逻辑处理交给LUA处理
|
|
逻辑处理交给LUA处理
|
|
@@ -26,7 +27,7 @@ func init() {
|
|
regImg, _ = regexp.Compile(regImgStr)
|
|
regImg, _ = regexp.Compile(regImgStr)
|
|
}
|
|
}
|
|
|
|
|
|
-//下载页面,发送消息,等待下载
|
|
|
|
|
|
+// 下载页面,发送消息,等待下载
|
|
func Download(retLen *int64, downloaderid, url, method string, head map[string]interface{}, encoding string, useproxy, ishttps bool, code string, timeout int64) string {
|
|
func Download(retLen *int64, downloaderid, url, method string, head map[string]interface{}, encoding string, useproxy, ishttps bool, code string, timeout int64) string {
|
|
defer mu.Catch()
|
|
defer mu.Catch()
|
|
msgid := mu.UUID(8)
|
|
msgid := mu.UUID(8)
|
|
@@ -83,7 +84,7 @@ func Download(retLen *int64, downloaderid, url, method string, head map[string]i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-//下载页面,发送消息,等待下载
|
|
|
|
|
|
+// 下载页面,发送消息,等待下载
|
|
func DownloadAdv(retLen *int64, downloaderid, url, method string, reqparam, head map[string]interface{}, mycookie []*http.Cookie, encoding string, useproxy, ishttps bool, code string, timeout int64) (string, []*http.Cookie, map[string]interface{}) {
|
|
func DownloadAdv(retLen *int64, downloaderid, url, method string, reqparam, head map[string]interface{}, mycookie []*http.Cookie, encoding string, useproxy, ishttps bool, code string, timeout int64) (string, []*http.Cookie, map[string]interface{}) {
|
|
defer mu.Catch()
|
|
defer mu.Catch()
|
|
msgid := mu.UUID(8)
|
|
msgid := mu.UUID(8)
|
|
@@ -200,7 +201,7 @@ func DownloadAdvNew(downloaderid, url, method string, reqparam, head map[string]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-//下载附件
|
|
|
|
|
|
+// 下载附件
|
|
func DownloadFile_bak(downloaderid, url, method string, reqparam, head map[string]interface{}, mycookie []*http.Cookie, encoding string, useproxy, ishttps bool, code string, timeout int64) []byte {
|
|
func DownloadFile_bak(downloaderid, url, method string, reqparam, head map[string]interface{}, mycookie []*http.Cookie, encoding string, useproxy, ishttps bool, code string, timeout int64) []byte {
|
|
defer mu.Catch()
|
|
defer mu.Catch()
|
|
msgid := mu.UUID(8)
|
|
msgid := mu.UUID(8)
|
|
@@ -384,7 +385,7 @@ func DownloadByChrome(code, downloaderid string, chrometask lu.ChromeTask, timeo
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//下载点是否可用
|
|
|
|
|
|
+// 下载点是否可用
|
|
func isAvailable(code string) bool {
|
|
func isAvailable(code string) bool {
|
|
b := false
|
|
b := false
|
|
for k, _ := range Alldownloader {
|
|
for k, _ := range Alldownloader {
|
|
@@ -395,7 +396,7 @@ func isAvailable(code string) bool {
|
|
return b
|
|
return b
|
|
}
|
|
}
|
|
|
|
|
|
-//下载点是否可用
|
|
|
|
|
|
+// 下载点是否可用
|
|
func isAvailableFile(code string) bool {
|
|
func isAvailableFile(code string) bool {
|
|
b := false
|
|
b := false
|
|
for k, _ := range AlldownloaderFile {
|
|
for k, _ := range AlldownloaderFile {
|