Przeglądaj źródła

修改接口启动时间

zhangyong 9 miesięcy temu
rodzic
commit
648d34ad2c
1 zmienionych plików z 3 dodań i 7 usunięć
  1. 3 7
      spider/crawler_offline/xiaoniangao_zhanghao.py

+ 3 - 7
spider/crawler_offline/xiaoniangao_zhanghao.py

@@ -102,14 +102,10 @@ class XiaoNianGaoZH(object):
 
 
     def save_pq_uid(self, uid):
-        # 获取当前日期
-        today = datetime.now().date()
-
-        # 创建当天0点20分的时间
-        zero_twenty = datetime.combine(today, datetime.min.time()) + timedelta(minutes=20)
-
+        current_time = datetime.now()
+        time_after_10_minutes = current_time + timedelta(minutes=5)
         # 获取时间戳
-        timestamp_seconds = zero_twenty.timestamp()
+        timestamp_seconds = time_after_10_minutes.timestamp()
         timestamp_milliseconds = int(timestamp_seconds * 1000)
         file_path = '/Users/tzld/Desktop/automatic_crawler/spider/crawler_offline/xng_zh.txt'
         with open(file_path, 'r') as file: