|
@@ -608,6 +608,14 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
|
util.TimeSleepFunc(time.Second*2, TimeSleepChan)
|
|
|
return 0
|
|
|
}))
|
|
|
+ s.L.SetGlobal("runSleep", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
+ t := S.ToInt(-1)
|
|
|
+ if t <= 0 {
|
|
|
+ t = 1
|
|
|
+ }
|
|
|
+ time.Sleep(time.Duration(t) * time.Second)
|
|
|
+ return 0
|
|
|
+ }))
|
|
|
//编码解码
|
|
|
s.L.SetGlobal("transCode", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
codeType := strings.ToLower(S.ToString(-2))
|
|
@@ -1234,16 +1242,16 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
|
return 1
|
|
|
}))
|
|
|
//针对中国招标投标公共服务平台三级页瑞数加密下载方法
|
|
|
- s.L.SetGlobal("downloadByDataIntercept", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
- url := S.ToString(-4)
|
|
|
- url_regex := S.ToString(-3)
|
|
|
- timeout := S.ToInt(-2)
|
|
|
- proxy := S.ToBool(-1)
|
|
|
- headers := util.DownloadByDataIntercept(url, url_regex, timeout, proxy)
|
|
|
- table := util.MapToLuaTable(S, headers)
|
|
|
- S.Push(table)
|
|
|
- return 1
|
|
|
- }))
|
|
|
+ //s.L.SetGlobal("downloadByDataIntercept", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
+ // url := S.ToString(-4)
|
|
|
+ // url_regex := S.ToString(-3)
|
|
|
+ // timeout := S.ToInt(-2)
|
|
|
+ // proxy := S.ToBool(-1)
|
|
|
+ // headers := util.DownloadByDataIntercept(url, url_regex, timeout, proxy)
|
|
|
+ // table := util.MapToLuaTable(S, headers)
|
|
|
+ // S.Push(table)
|
|
|
+ // return 1
|
|
|
+ //}))
|
|
|
return ""
|
|
|
}
|
|
|
func dealHref(pageListUrl, href string) string {
|