浏览代码

update xiaoniangao

wangkun 2 年之前
父节点
当前提交
c74347a17b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      xiaoniangao/xiaoniangao_hour/xiaoniangao_hour.py

+ 1 - 1
xiaoniangao/xiaoniangao_hour/xiaoniangao_hour.py

@@ -469,7 +469,7 @@ class XiaoniangaoHour:
         try:
         try:
             befor_yesterday = (datetime.date.today() + datetime.timedelta(days=-3)).strftime("%Y-%m-%d %H:%M:%S")
             befor_yesterday = (datetime.date.today() + datetime.timedelta(days=-3)).strftime("%Y-%m-%d %H:%M:%S")
             update_time_stamp = int(time.mktime(time.strptime(befor_yesterday, "%Y-%m-%d %H:%M:%S")))
             update_time_stamp = int(time.mktime(time.strptime(befor_yesterday, "%Y-%m-%d %H:%M:%S")))
-            select_sql = f""" select * from crawler_xiaoniangao_hour where crawler_time_stamp >= {update_time_stamp} """
+            select_sql = f""" select * from crawler_xiaoniangao_hour where crawler_time_stamp >= {update_time_stamp} GROUP BY out_video_id """
             update_video_list = MysqlHelper.get_values(log_type, crawler, select_sql, env)
             update_video_list = MysqlHelper.get_values(log_type, crawler, select_sql, env)
             if len(update_video_list) == 0:
             if len(update_video_list) == 0:
                 Common.logger(log_type, crawler).info("暂无需要更新的小时榜数据\n")
                 Common.logger(log_type, crawler).info("暂无需要更新的小时榜数据\n")