run_bot.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2022/8/9
  4. # import datetime
  5. import datetime
  6. import os
  7. import sys
  8. import time
  9. sys.path.append(os.getcwd())
  10. from main.common import Common
  11. from main.feishu_lib import Feishu
  12. class Bot:
  13. # 获取各个爬虫表最新一条抓取时间
  14. @classmethod
  15. def get_first_time(cls, log_type, crawler):
  16. try:
  17. if crawler == "xiaoniangao_hour":
  18. sheet = Feishu.get_values_batch(log_type, "xiaoniangao", "yatRv2")
  19. # 已下载表,最新一条视频抓取时间
  20. first_download_time = sheet[1][5]
  21. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  22. elif crawler == "xiaoniangao_person":
  23. sheet = Feishu.get_values_batch(log_type, "xiaoniangao", "Wu0CeL")
  24. # 已下载表,最新一条视频抓取时间
  25. first_download_time = sheet[1][5]
  26. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  27. elif crawler == "xiaoniangao_play":
  28. sheet = Feishu.get_values_batch(log_type, "xiaoniangao", "c85k1C")
  29. # 已下载表,最新一条视频抓取时间
  30. first_download_time = sheet[1][5]
  31. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  32. elif crawler == 'xigua_video':
  33. sheet = Feishu.get_values_batch(log_type, "xigua", "e075e9")
  34. # 已下载表,最新一条视频抓取时间
  35. first_download_time = sheet[1][5]
  36. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  37. elif crawler == 'xigua_little_video':
  38. sheet = Feishu.get_values_batch(log_type, "xigua", "hDSDnv")
  39. # 已下载表,最新一条视频抓取时间
  40. first_download_time = sheet[1][5]
  41. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  42. elif crawler == 'zhihu_hot':
  43. sheet = Feishu.get_values_batch(log_type, "zhihu", "8871e3")
  44. # 已下载表,最新一条视频抓取时间
  45. first_download_time = sheet[1][5]
  46. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  47. elif crawler == 'zhihu_follow':
  48. sheet = Feishu.get_values_batch(log_type, "zhihu", "4MGuux")
  49. # 已下载表,最新一条视频抓取时间
  50. first_download_time = sheet[1][5]
  51. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  52. elif crawler == 'haokan_hot':
  53. sheet = Feishu.get_values_batch(log_type, "haokan", "5pWipX")
  54. # 已下载表,最新一条视频抓取时间
  55. first_download_time = sheet[1][5]
  56. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  57. elif crawler == 'haokan_channel':
  58. sheet = Feishu.get_values_batch(log_type, "haokan", "7f05d8")
  59. # 已下载表,最新一条视频抓取时间
  60. first_download_time = sheet[1][5]
  61. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  62. elif crawler == 'ssyy':
  63. sheet = Feishu.get_values_batch(log_type, "ssyy", "59f11d")
  64. # 已下载表,最新一条视频抓取时间
  65. first_download_time = sheet[1][5]
  66. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  67. elif crawler == 'jxxf':
  68. sheet = Feishu.get_values_batch(log_type, "jxxf", "d9e9b1")
  69. # 已下载表,最新一条视频抓取时间
  70. first_download_time = sheet[1][5]
  71. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  72. elif crawler == 'zmyx':
  73. sheet = Feishu.get_values_batch(log_type, "zmyx", "19c772")
  74. # 已下载表,最新一条视频抓取时间
  75. first_download_time = sheet[1][5]
  76. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  77. elif crawler == 'zhufumao':
  78. sheet = Feishu.get_values_batch(log_type, "zhufumao", "e13bdf")
  79. # 已下载表,最新一条视频抓取时间
  80. first_download_time = sheet[1][5]
  81. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  82. elif crawler == 'ssnnyfq':
  83. sheet = Feishu.get_values_batch(log_type, "ssnnyfq", "290bae")
  84. # 已下载表,最新一条视频抓取时间
  85. first_download_time = sheet[1][5]
  86. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  87. elif crawler == 'kdjsfq':
  88. sheet = Feishu.get_values_batch(log_type, "kdjsfq", "ad3b6d")
  89. # 已下载表,最新一条视频抓取时间
  90. first_download_time = sheet[1][5]
  91. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  92. elif crawler == "kanyikan":
  93. sheet = Feishu.get_values_batch(log_type, "kanyikan", "20ce0c")
  94. # 已下载表,最新一条视频抓取时间
  95. first_download_time = sheet[1][5]
  96. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  97. elif crawler == "music_album":
  98. sheet = Feishu.get_values_batch(log_type, "music_album", "f5a76e")
  99. # 已下载表,最新一条视频抓取时间
  100. first_download_time = sheet[1][5]
  101. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  102. elif crawler == "bszf":
  103. sheet = Feishu.get_values_batch(log_type, "bszf", "440018")
  104. # 已下载表,最新一条视频抓取时间
  105. first_download_time = sheet[1][4]
  106. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  107. elif crawler == "kuaishou_recommend":
  108. sheet = Feishu.get_values_batch(log_type, "kuaishou", "3cd128")
  109. # 已下载表,最新一条视频抓取时间
  110. first_download_time = sheet[1][5]
  111. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  112. elif crawler == "kuaishou_follow":
  113. sheet = Feishu.get_values_batch(log_type, "kuaishou", "fYdA8F")
  114. # 已下载表,最新一条视频抓取时间
  115. first_download_time = sheet[1][5]
  116. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  117. elif crawler == "gzh":
  118. sheet = Feishu.get_values_batch(log_type, "gzh", "fCs3BT")
  119. # 已下载表,最新一条视频抓取时间
  120. first_download_time = sheet[1][3]
  121. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  122. elif crawler == "weiqun":
  123. sheet = Feishu.get_values_batch(log_type, "weiqun", "3cd128")
  124. # 已下载表,最新一条视频抓取时间
  125. first_download_time = sheet[1][5]
  126. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  127. elif crawler == "weishi":
  128. sheet = Feishu.get_values_batch(log_type, "weishi", "caa3fa")
  129. # 已下载表,最新一条视频抓取时间
  130. first_download_time = sheet[1][5]
  131. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  132. elif crawler == "shipinhao_recommend":
  133. sheet = Feishu.get_values_batch(log_type, "shipinhao", "c77cf9")
  134. # 已下载表,最新一条视频抓取时间
  135. first_download_time = sheet[1][5]
  136. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  137. elif crawler == "shipinhao_follow":
  138. sheet = Feishu.get_values_batch(log_type, "shipinhao", "KsVtLe")
  139. # 已下载表,最新一条视频抓取时间
  140. first_download_time = sheet[1][5]
  141. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  142. elif crawler == "zongjiao":
  143. sheet = Feishu.get_values_batch(log_type, "zongjiao", "xf9wC2")
  144. # 已下载表,最新一条视频抓取时间
  145. first_download_time = sheet[1][5]
  146. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  147. else:
  148. sheet = Feishu.get_values_batch(log_type, "xiaoniangao", "yatRv2")
  149. # 已下载表,最新一条视频抓取时间
  150. first_download_time = sheet[1][5]
  151. first_download_time = int(time.mktime(time.strptime(first_download_time, "%Y/%m/%d %H:%M:%S")))
  152. return first_download_time
  153. except Exception as e:
  154. Common.logger(log_type).error(f"get_first_time异常:{e}\n")
  155. # 触发机器人报警:超过24小时没有新入库的视频
  156. @classmethod
  157. def robot_download_sheet(cls, log_type, crawler, duration):
  158. """
  159. 已下载视频表:超过24小时没有新入库的视频
  160. """
  161. try:
  162. # 看一看爬虫报警
  163. if crawler == "kanyikan" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  164. Feishu.bot(log_type, crawler, "看一看已下载表,超过24小时没有新视频入库了😤")
  165. Common.logger(log_type).warning("看一看已下载表,超过24小时没有新视频入库了😤\n")
  166. # 小年糕爬虫报警
  167. elif crawler == "xiaoniangao_hour" and (
  168. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  169. Feishu.bot(log_type, crawler, "小年糕_小时级_已下载表,超过24小时没有新视频入库了😤")
  170. Common.logger(log_type).warning("小年糕_小时级_已下载表,超过24小时没有新视频入库了😤\n")
  171. elif crawler == "xiaoniangao_person" and (
  172. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  173. Feishu.bot(log_type, crawler, "小年糕_用户主页_已下载表,超过24小时没有新视频入库了😤")
  174. Common.logger(log_type).warning("小年糕_用户主页_已下载表,超过24小时没有新视频入库了😤\n")
  175. elif crawler == "xiaoniangao_play" and (
  176. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  177. Feishu.bot(log_type, crawler, "小年糕_播放量_已下载表,超过24小时没有新视频入库了😤")
  178. Common.logger(log_type).warning("小年糕_播放量_已下载表,超过24小时没有新视频入库了😤\n")
  179. # 西瓜视频
  180. elif crawler == "xigua_video" and (
  181. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  182. Feishu.bot(log_type, crawler, "西瓜视频_用户主页_已下载表,超过24小时没有新视频入库了😤")
  183. Common.logger(log_type).warning("西瓜视频_用户主页_已下载表,超过24小时没有新视频入库了😤\n")
  184. elif crawler == "xigua_little_video" and (
  185. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  186. Feishu.bot(log_type, crawler, "西瓜视频_小视频_已下载表,超过24小时没有新视频入库了😤")
  187. Common.logger(log_type).warning("西瓜视频_小视频_已下载表,超过24小时没有新视频入库了😤\n")
  188. # 知乎
  189. elif crawler == "zhihu_hot" and (
  190. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  191. Feishu.bot(log_type, crawler, "知乎_热门_已下载表,超过24小时没有新视频入库了😤")
  192. Common.logger(log_type).warning("知乎_热门_已下载表,超过24小时没有新视频入库了😤\n")
  193. elif crawler == "zhihu_follow" and (
  194. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  195. Feishu.bot(log_type, crawler, "知乎_定向_已下载表,超过24小时没有新视频入库了😤")
  196. Common.logger(log_type).warning("知乎_定向_已下载表,超过24小时没有新视频入库了😤\n")
  197. # 好看视频
  198. elif crawler == "haokan_hot" and (
  199. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  200. Feishu.bot(log_type, crawler, "好看_热榜_已下载表,超过24小时没有新视频入库了😤")
  201. Common.logger(log_type).warning("好看_热榜_已下载表,超过24小时没有新视频入库了😤\n")
  202. elif crawler == "haokan_channel" and (
  203. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  204. Feishu.bot(log_type, crawler, "好看_频道_已下载表,超过24小时没有新视频入库了😤")
  205. Common.logger(log_type).warning("好看_频道_已下载表,超过24小时没有新视频入库了😤\n")
  206. # 胜胜影音
  207. elif crawler == "ssyy" and (
  208. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  209. Feishu.bot(log_type, crawler, "胜胜影音_已下载表,超过24小时没有新视频入库了😤")
  210. Common.logger(log_type).warning("胜胜影音_已下载表,超过24小时没有新视频入库了😤\n")
  211. # 吉祥幸福
  212. elif crawler == "jxxf" and (
  213. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  214. Feishu.bot(log_type, crawler, "吉祥幸福_已下载表,超过24小时没有新视频入库了😤")
  215. Common.logger(log_type).warning("吉祥幸福_已下载表,超过24小时没有新视频入库了😤\n")
  216. # 众妙音信
  217. elif crawler == "zmyx" and (
  218. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  219. Feishu.bot(log_type, crawler, "众妙音信_已下载表,超过24小时没有新视频入库了😤")
  220. Common.logger(log_type).warning("众妙音信_已下载表,超过24小时没有新视频入库了😤\n")
  221. # 祝福猫视频
  222. elif crawler == "zhufumao" and (
  223. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  224. Feishu.bot(log_type, crawler, "祝福猫_已下载表,超过24小时没有新视频入库了😤")
  225. Common.logger(log_type).warning("祝福猫_已下载表,超过24小时没有新视频入库了😤\n")
  226. # 岁岁年年迎福气
  227. elif crawler == "ssnnyfq" and (
  228. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  229. Feishu.bot(log_type, crawler, "岁岁年年迎福气_已下载表,超过24小时没有新视频入库了😤")
  230. Common.logger(log_type).warning("岁岁年年迎福气_已下载表,超过24小时没有新视频入库了😤\n")
  231. # 看到就是福气
  232. elif crawler == "kdjsfq" and (
  233. int(time.time()) - int(cls.get_first_time(log_type, crawler)) > int(duration)):
  234. Feishu.bot(log_type, crawler, "看到就是福气_已下载表,超过24小时没有新视频入库了😤")
  235. Common.logger(log_type).warning("看到就是福气_已下载表,超过24小时没有新视频入库了😤\n")
  236. # 音乐相册爬虫报警
  237. elif crawler == "music_album" and (
  238. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  239. Feishu.bot(log_type, crawler, "音乐相册已下载表,超过24小时没有新视频入库了😤")
  240. Common.logger(log_type).warning("音乐相册已下载表,超过24小时没有新视频入库了😤\n")
  241. # 本山祝福爬虫报警
  242. elif crawler == "bszf" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  243. Feishu.bot(log_type, crawler, "本山祝福已下载表,超过24小时没有新视频入库了😤")
  244. Common.logger(log_type).warning("本山祝福已下载表,超过24小时没有新视频入库了😤\n")
  245. # 快手爬虫报警
  246. elif crawler == "kuaishou_recommend" and (
  247. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  248. Feishu.bot(log_type, crawler, "快手_推荐榜_已下载表,超过24小时没有新视频入库了😤")
  249. Common.logger(log_type).warning("快手_推荐榜_已下载表,超过24小时没有新视频入库了😤\n")
  250. elif crawler == "kuaishou_follow" and (
  251. int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  252. Feishu.bot(log_type, crawler, "快手_用户主页_已下载表,超过24小时没有新视频入库了😤")
  253. Common.logger(log_type).warning("快手_用户主页_已下载表,超过24小时没有新视频入库了😤\n")
  254. # 公众号爬虫报警
  255. elif crawler == "gzh" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  256. Feishu.bot(log_type, crawler, "公众号已下载表,超过24小时没有新视频入库了😤")
  257. Common.logger(log_type).warning("公众号已下载表,超过24小时没有新视频入库了😤\n")
  258. # 微群视频爬虫报警
  259. elif crawler == "weiqun" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  260. Feishu.bot(log_type, crawler, "微群视频已下载表,超过24小时没有新视频入库了😤")
  261. Common.logger(log_type).warning("微群视频已下载表,超过24小时没有新视频入库了😤\n")
  262. # 微视爬虫报警
  263. elif crawler == "weishi" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  264. Feishu.bot(log_type, crawler, "微视已下载表,超过24小时没有新视频入库了😤")
  265. Common.logger(log_type).warning("微视已下载表,超过24小时没有新视频入库了😤\n")
  266. # 视频号爬虫报警
  267. elif crawler == "shipinhao_recommend" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  268. Feishu.bot(log_type, crawler, "视频号_推荐_已下载表,超过24小时没有新视频入库了😤")
  269. Common.logger(log_type).warning("视频号_推荐_已下载表,超过24小时没有新视频入库了😤\n")
  270. elif crawler == "shipinhao_follow" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  271. Feishu.bot(log_type, crawler, "视频号_定向_已下载表,超过24小时没有新视频入库了😤")
  272. Common.logger(log_type).warning("视频号_定向_已下载表,超过24小时没有新视频入库了😤\n")
  273. # 宗教公众号爬虫报警
  274. elif crawler == "zongjiao" and (int(time.time()) - cls.get_first_time(log_type, crawler) > int(duration)):
  275. Feishu.bot(log_type, crawler, "宗教公众号已下载表,超过24小时没有新视频入库了😤")
  276. Common.logger(log_type).warning("宗教公众号已下载表,超过24小时没有新视频入库了😤\n")
  277. except Exception as e:
  278. Common.logger(log_type).error(f"robot_alarm异常:{e}\n")
  279. # 监控运行入口
  280. @classmethod
  281. def main(cls):
  282. """
  283. 每隔六小时,检查一次已下载表;
  284. 已下载表的最新一条数据抓取时间,距当前时间超过 24 小时,则触发机器人报警,发送飞书报警消息
  285. """
  286. # 已下载表,超过 24 小时无新视频入库报警
  287. duration = 3600 * 24
  288. while True:
  289. if datetime.datetime.now().hour == 10:
  290. Common.logger("bot").info("监控看一看已下载表")
  291. Bot.robot_download_sheet("bot", "kanyikan", duration)
  292. Common.logger("bot").info("监控小年糕已下载表")
  293. Bot.robot_download_sheet("bot", "xiaoniangao_hour", duration)
  294. Bot.robot_download_sheet("bot", "xiaoniangao_person", duration)
  295. Bot.robot_download_sheet("bot", "xiaoniangao_play", duration)
  296. # Common.logger("bot").info("监控西瓜视频已下载表")
  297. # Bot.robot_download_sheet("bot", "xigua_video", duration)
  298. # Bot.robot_download_sheet("bot", "xigua_little_video", duration)
  299. Common.logger('bot').info('监控知乎已下载表')
  300. Bot.robot_download_sheet("bot", "zhihu_hot", duration)
  301. Bot.robot_download_sheet("bot", "zhihu_follow", duration)
  302. Common.logger('bot').info('监控好看已下载表')
  303. Bot.robot_download_sheet("bot", "haokan_hot", duration)
  304. Bot.robot_download_sheet("bot", "haokan_channel", duration)
  305. # Common.logger("bot").info("监控胜胜影音已下载表")
  306. # Bot.robot_download_sheet("bot", "ssyy", duration)
  307. Common.logger("bot").info("监控吉祥幸福已下载表")
  308. Bot.robot_download_sheet("bot", "jxxf", duration)
  309. # Common.logger("bot").info("监控众妙音信已下载表")
  310. # Bot.robot_download_sheet("bot", "zmyx", duration)
  311. # Common.logger("bot").info("监控祝福猫已下载表")
  312. # Bot.robot_download_sheet("bot", "zhufumao", duration)
  313. Common.logger("bot").info("监控岁岁年年迎福气已下载表")
  314. Bot.robot_download_sheet("bot", "ssnnyfq", duration)
  315. Common.logger("bot").info("监控看到就是福气已下载表")
  316. Bot.robot_download_sheet("bot", "kdjsfq", duration)
  317. Common.logger("bot").info("监控本山祝福已下载表")
  318. Bot.robot_download_sheet("bot", "bszf", duration)
  319. Common.logger("bot").info("监控快手已下载表")
  320. Bot.robot_download_sheet("bot", "kuaishou_recommend", duration)
  321. Bot.robot_download_sheet("bot", "kuaishou_follow", duration)
  322. Common.logger("bot").info("监控微视已下载表")
  323. Bot.robot_download_sheet("bot", "weishi", duration)
  324. Common.logger("bot").info("监控视频号已下载表")
  325. # Bot.robot_download_sheet("bot", "shipinhao_recommend", duration)
  326. Bot.robot_download_sheet("bot", "shipinhao_follow", duration)
  327. Common.logger("bot").info("监控宗教公众号已下载表")
  328. Bot.robot_download_sheet("bot", "zongjiao", duration)
  329. # Common.logger("bot").info("监控公众号已下载表")
  330. # Bot.robot_download_sheet("bot", "gzh", duration)
  331. # Common.logger("bot").info("监控音乐相册已下载表")
  332. # Bot.robot_download_sheet("bot", "music_album", duration)
  333. # Common.logger("bot").info("监控微群视频已下载表")
  334. # Bot.robot_download_sheet("bot", "weiqun", duration)
  335. Common.del_logs("bot")
  336. Common.logger("bot").info(f"休眠{24-datetime.datetime.now().hour}小时")
  337. time.sleep(3600 * (24-datetime.datetime.now().hour))
  338. else:
  339. pass
  340. if __name__ == "__main__":
  341. # Bot.robot_download_sheet("bot", "ssyy", 1)
  342. Bot.main()
  343. pass