wangkun 2 лет назад
Родитель
Сommit
c8b695f4f0
2 измененных файлов с 23 добавлено и 10 удалено
  1. 7 4
      main/feishu_lib.py
  2. 16 6
      main/run_bot.py

+ 7 - 4
main/feishu_lib.py

@@ -389,9 +389,12 @@ class Feishu:
                 content = "本山祝福爬虫表"
                 sheet_url = "https://w42nne6hzg.feishu.cn/sheets/shtcnGh2rrsPYM4iVNEBO7OqWrb"
 
-            elif crawler == "kuaishou":
-                content = "快手爬虫表"
-                sheet_url = "https://w42nne6hzg.feishu.cn/sheets/shtcnICEfaw9llDNQkKgdymM1xf"
+            elif crawler == "kuaishou_follow":
+                content = "快手_用户主页_已下载表"
+                sheet_url = "https://w42nne6hzg.feishu.cn/sheets/shtcnICEfaw9llDNQkKgdymM1xf?sheet=fYdA8F"
+            elif crawler == "kuaishou_recommend":
+                content = "快手_推荐榜_已下载表"
+                sheet_url = "https://w42nne6hzg.feishu.cn/sheets/shtcnICEfaw9llDNQkKgdymM1xf?sheet=3cd128"
 
             elif crawler == "gzh":
                 content = "公众号爬虫表"
@@ -455,7 +458,7 @@ class Feishu:
 
 
 if __name__ == "__main__":
-    Feishu.bot("bot", "xigua_little_video", "嘿。嘿嘿。。嘿嘿嘿")
+    Feishu.bot("bot", "kuaishou_recommend", "嘿。嘿嘿。。嘿嘿嘿")
     # Feishu.get_userid("kuaishou", "huxinxue")
     
     pass

+ 16 - 6
main/run_bot.py

@@ -133,11 +133,16 @@ class Bot:
                 first_download_time = sheet[1][4]
                 first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
 
-            elif crawler == "kuaishou":
+            elif crawler == "kuaishou_recommend":
                 sheet = Feishu.get_values_batch(log_type, "kuaishou", "3cd128")
                 # 已下载表,最新一条视频抓取时间
                 first_download_time = sheet[1][5]
                 first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
+            elif crawler == "kuaishou_follow":
+                sheet = Feishu.get_values_batch(log_type, "kuaishou", "fYdA8F")
+                # 已下载表,最新一条视频抓取时间
+                first_download_time = sheet[1][5]
+                first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
 
             elif crawler == "gzh":
                 sheet = Feishu.get_values_batch(log_type, "gzh", "fCs3BT")
@@ -221,9 +226,12 @@ class Bot:
                 Common.logger(log_type).warning("本山祝福已下载表,超过24小时没有新视频入库了😤\n")
 
             # 快手爬虫报警
-            elif crawler == "kuaishou" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
-                Feishu.bot(log_type, crawler, "快手已下载表,超过24小时没有新视频入库了😤")
-                Common.logger(log_type).warning("快手已下载表,超过24小时没有新视频入库了😤\n")
+            elif crawler == "kuaishou_recommend" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
+                Feishu.bot(log_type, crawler, "快手_推荐榜_已下载表,超过24小时没有新视频入库了😤")
+                Common.logger(log_type).warning("快手_推荐榜_已下载表,超过24小时没有新视频入库了😤\n")
+            elif crawler == "kuaishou_follow" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
+                Feishu.bot(log_type, crawler, "快手_用户主页_已下载表,超过24小时没有新视频入库了😤")
+                Common.logger(log_type).warning("快手_用户主页_已下载表,超过24小时没有新视频入库了😤\n")
 
             # 公众号爬虫报警
             elif crawler == "gzh" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
@@ -276,7 +284,8 @@ class Bot:
                 Bot.robot_download_sheet("bot", "bszf", duration)
 
                 Common.logger("bot").info("监控快手已下载表")
-                Bot.robot_download_sheet("bot", "kuaishou", duration)
+                Bot.robot_download_sheet("bot", "kuaishou_recommend", duration)
+                Bot.robot_download_sheet("bot", "kuaishou_follow", duration)
 
                 Common.logger("bot").info("监控微视已下载表")
                 Bot.robot_download_sheet("bot", "weishi", duration)
@@ -301,7 +310,8 @@ class Bot:
 
 
 if __name__ == "__main__":
-    # Bot.robot_download_sheet("bot", "xigua_video", 1)
+    # Bot.robot_download_sheet("bot", "kuaishou_recommend", 1)
+    # Bot.robot_download_sheet("bot", "kuaishou_follow", 1)
     Bot.main()
 
     pass