|
@@ -140,27 +140,6 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
|
}
|
|
|
var retLen int64
|
|
|
ret := Download(&retLen, s.Downloader, url, "get", util.GetTable(head), charset, s.Userproxy, ishttps, s.SCode, s.Timeout)
|
|
|
- //流量统计
|
|
|
- //if retLen > 0 {
|
|
|
- // key := Today + "+" + code
|
|
|
- // if sf, ok := SpiderFlowMap.Load(key); ok && sf != nil {
|
|
|
- // if sfMap, ok := sf.(*SpiderFlow); ok {
|
|
|
- // sfMap.Flow += retLen
|
|
|
- // //sfMap.Site = *site
|
|
|
- // //sfMap.Channel = *channel
|
|
|
- // //sfMap.ModifyUser = *user
|
|
|
- // SpiderFlowMap.Store(key, sfMap)
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // SpiderFlowMap.Store(key, &SpiderFlow{
|
|
|
- // //Code: code,
|
|
|
- // Site: *site,
|
|
|
- // Channel: *channel,
|
|
|
- // Flow: retLen,
|
|
|
- // ModifyUser: *user,
|
|
|
- // })
|
|
|
- // }
|
|
|
- //}
|
|
|
S.Push(lua.LString(ret))
|
|
|
atomic.AddInt32(&s.ToDayRequestNum, 1)
|
|
|
atomic.AddInt32(&s.TotalRequestNum, 1)
|
|
@@ -202,27 +181,6 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
|
} else {
|
|
|
ret, retcookie, headers = DownloadAdv(&retLen, s.Downloader, url, method, util.GetTable(param), util.GetTable(head), mycookie, charset, s.Userproxy, ishttps, s.SCode, s.Timeout)
|
|
|
}
|
|
|
- //流量统计
|
|
|
- //if retLen > 0 {
|
|
|
- // key := Today + "+" + code
|
|
|
- // if sf, ok := SpiderFlowMap.Load(key); ok && sf != nil {
|
|
|
- // if sfMap, ok := sf.(*SpiderFlow); ok {
|
|
|
- // sfMap.Flow += retLen
|
|
|
- // //sfMap.Site = *site
|
|
|
- // //sfMap.Channel = *channel
|
|
|
- // //sfMap.ModifyUser = *user
|
|
|
- // SpiderFlowMap.Store(key, sfMap)
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // SpiderFlowMap.Store(key, &SpiderFlow{
|
|
|
- // //Code: code,
|
|
|
- // Site: *site,
|
|
|
- // Channel: *channel,
|
|
|
- // Flow: retLen,
|
|
|
- // ModifyUser: *user,
|
|
|
- // })
|
|
|
- // }
|
|
|
- //}
|
|
|
S.Push(lua.LString(ret))
|
|
|
scookie, _ := json.Marshal(retcookie)
|
|
|
S.Push(lua.LString(scookie))
|