|
@@ -53,6 +53,12 @@ class Bot:
|
|
|
# 已下载表,最新一条视频抓取时间
|
|
|
first_download_time = sheet[1][3]
|
|
|
first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
|
|
|
+ elif crawler == "weiqun":
|
|
|
+ sheet = Feishu.get_values_batch(log_type, "weiqun", "3cd128")
|
|
|
+ # print(sheet[1])
|
|
|
+ # 已下载表,最新一条视频抓取时间
|
|
|
+ first_download_time = sheet[1][5]
|
|
|
+ first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
|
|
|
else:
|
|
|
sheet = Feishu.get_values_batch(log_type, "xiaoniangao", "yatRv2")
|
|
|
# 已下载表,最新一条视频抓取时间
|
|
@@ -140,26 +146,42 @@ class Bot:
|
|
|
已下载视频表:超过24小时没有新入库的视频
|
|
|
"""
|
|
|
try:
|
|
|
+ # 看一看爬虫报警
|
|
|
if crawler == "kanyikan" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
|
|
|
Feishu.bot(log_type, crawler, "看一看已下载表,超过24小时没有新视频入库了😤")
|
|
|
Common.logger(log_type).info("看一看已下载表,超过24小时没有新视频入库了😤\n")
|
|
|
+
|
|
|
+ # 小年糕爬虫报警
|
|
|
elif crawler == "xiaoniangao" and (
|
|
|
int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
|
|
|
Feishu.bot(log_type, crawler, "小年糕已下载表,超过24小时没有新视频入库了😤")
|
|
|
Common.logger(log_type).info("小年糕已下载表,超过24小时没有新视频入库了😤\n")
|
|
|
+
|
|
|
+ # 音乐相册爬虫报警
|
|
|
elif crawler == "music_album" and (
|
|
|
int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
|
|
|
Feishu.bot(log_type, crawler, "音乐相册已下载表,超过24小时没有新视频入库了😤")
|
|
|
Common.logger(log_type).info("音乐相册已下载表,超过24小时没有新视频入库了😤\n")
|
|
|
+
|
|
|
+ # 本山祝福爬虫报警
|
|
|
elif crawler == "bszf" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
|
|
|
Feishu.bot(log_type, crawler, "本山祝福已下载表,超过24小时没有新视频入库了😤")
|
|
|
Common.logger(log_type).info("本山祝福已下载表,超过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).info("快手已下载表,超过24小时没有新视频入库了😤\n")
|
|
|
+
|
|
|
+ # 公众号爬虫报警
|
|
|
elif crawler == "gzh" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
|
|
|
- Feishu.bot(log_type, crawler, "公众号已下载表,超过24小时没有新视频入库了😤]️")
|
|
|
+ Feishu.bot(log_type, crawler, "公众号已下载表,超过24小时没有新视频入库了😤")
|
|
|
Common.logger(log_type).info("公众号已下载表,超过24小时没有新视频入库了😤\n")
|
|
|
+
|
|
|
+ # 微群视频爬虫报警
|
|
|
+ elif crawler == "weiqun" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
|
|
|
+ Feishu.bot(log_type, crawler, "微群视频已下载表,超过24小时没有新视频入库了😤")
|
|
|
+ Common.logger(log_type).info("微群视频已下载表,超过24小时没有新视频入库了😤\n")
|
|
|
except Exception as e:
|
|
|
Common.logger(log_type).error("robot_alarm异常:{}", e)
|
|
|
|
|
@@ -190,6 +212,9 @@ class Bot:
|
|
|
Common.logger("bot").info("监控快手已下载表")
|
|
|
Bot.robot_download_sheet("bot", "kuaishou", duration)
|
|
|
|
|
|
+ Common.logger("bot").info("监控微群视频已下载表")
|
|
|
+ Bot.robot_download_sheet("bot", "weiqun", duration)
|
|
|
+
|
|
|
# Common.logger("bot").info("监控公众号已下载表")
|
|
|
# Bot.robot_alarm("bot", "gzh", duration)
|
|
|
|
|
@@ -203,4 +228,5 @@ class Bot:
|
|
|
if __name__ == "__main__":
|
|
|
# Bot.get_feeds_sheet("bot", "gzh", "recommend")
|
|
|
# Bot.rebot_feeds_sheet("bot", "gzh", "recommend")
|
|
|
+ # Bot.robot_download_sheet("bot", "weiqun", 10)
|
|
|
Bot.main()
|