|
@@ -480,22 +480,35 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
|
*num++ //视为已采集
|
|
|
return
|
|
|
}
|
|
|
- //db := HexToBigIntMod(href)
|
|
|
- //查询增量redis查看信息是否已经下载
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
- if isExist { //更新redis生命周期
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, href, 3600*24*30)
|
|
|
- *num++ //已采集
|
|
|
- return
|
|
|
- }
|
|
|
- log.Println("href had++:", isExist, href)
|
|
|
+ /*
|
|
|
+ //查询增量redis查看信息是否已经下载
|
|
|
+ isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
+ if isExist { //更新redis生命周期
|
|
|
+ util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, href, 3600*24*30)
|
|
|
+ *num++ //已采集
|
|
|
+ return
|
|
|
+ }
|
|
|
+ log.Println("href had++:", isExist, href)
|
|
|
+ */
|
|
|
if util.Config.Modal == 1 { //除7000、7500、7700节点外所有节点只采集列表页信息
|
|
|
+ isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
+ if isExist { //更新redis生命周期
|
|
|
+ util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, href, 3600*24*30)
|
|
|
+ *num++ //已采集
|
|
|
+ return
|
|
|
+ }
|
|
|
SaveHighListPageData(paramdata, href, num)
|
|
|
return
|
|
|
} else {
|
|
|
+ UpdateHeart(s.Code, s.MUserName, "detail") //记录modal=0老模式采集三级页心跳
|
|
|
+ isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
+ if isExist { //更新redis生命周期
|
|
|
+ util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, href, 3600*24*30)
|
|
|
+ *num++ //已采集
|
|
|
+ return
|
|
|
+ }
|
|
|
SaveListPageData(paramdata) //保存7000、7500、7700节点列表页采集的信息
|
|
|
}
|
|
|
- UpdateHeart(s.Code, s.MUserName, "detail") //记录modal=0老模式采集三级页心跳
|
|
|
//下载、解析、入库
|
|
|
data, err = s.DownloadDetailPage(paramdata, data)
|
|
|
if err != nil || data == nil {
|