Browse Source

run_download

wangkun 2 years ago
parent
commit
c745ef7893
3 changed files with 21 additions and 9 deletions
  1. 13 6
      main/demo.py
  2. 2 2
      main/hour_list.py
  3. 6 1
      main/run_hour_list.py

+ 13 - 6
main/demo.py

@@ -89,17 +89,24 @@ class Demo:
     # 时间
     @classmethod
     def times(cls):
-        before_yesterday = (datetime.date.today() + timedelta(days=-2)).strftime("%Y/%m/%d %H:%M:%S")
-        before_yesterday = time.strptime(before_yesterday, "%Y/%m/%d %H:%M:%S")
-        before_yesterday = int(time.mktime(before_yesterday))
-        print(before_yesterday)
-        print(type(before_yesterday))
+        # before_yesterday = (datetime.date.today() + timedelta(days=-2)).strftime("%Y/%m/%d %H:%M:%S")
+        # before_yesterday = time.strptime(before_yesterday, "%Y/%m/%d %H:%M:%S")
+        # before_yesterday = int(time.mktime(before_yesterday))
+        # print(before_yesterday)
+        # print(type(before_yesterday))
+
+        # v_upload_time = Feishu.get_values_batch("hour", "xiaoniangao", "ba0da4")[7][5]
+        # v_send_time = int(time.mktime(time.strptime(v_upload_time, "%Y-%m-%d %H:%M:%S")))
+        # print(v_upload_time)
+        # print(int(time.time()) - v_send_time)
+        pass
 
     # 微信号
     @classmethod
     def get_sheet(cls):
         hour_sheet = Feishu.get_values_batch("hour", "xiaoniangao", "ba0da4")
-        print(hour_sheet[2][8])
+        print(hour_sheet)
+        # print(hour_sheet[7][7])
 
 
 if __name__ == "__main__":

+ 2 - 2
main/hour_list.py

@@ -713,8 +713,8 @@ class HourList:
                         Common.logger(log_type).info("10:00 / 15:00 / 20:00 上升量: {} / {} / {}",
                                                      ten_cnt, fifteen_cnt, twenty_cnt)
 
-                        # 发布时间
-                        v_upload_time = download_hour_sheet[i][8]
+                        # 抓取时间
+                        v_upload_time = download_hour_sheet[i][9]
                         v_send_time = int(time.mktime(time.strptime(v_upload_time, "%Y-%m-%d %H:%M:%S")))
 
                         # 播放量

+ 6 - 1
main/run_hour_list.py

@@ -57,6 +57,11 @@ def run_update_hour_list():
     HourList.update_hour_list_data("hour", "2022-07-01", "2022-06-30", "2022-06-29")
 
 
+def run_download_and_publish():
+    HourList.download_and_publish("hour")
+
+
 if __name__ == "__main__":
-    hour_list_job()
+    # hour_list_job()
     # run_update_hour_list()
+    run_download_and_publish()