diff --git a/main.py b/main.py index d77e2e2..a9908f8 100644 --- a/main.py +++ b/main.py @@ -49,7 +49,11 @@ def main(chat_type: int): robot.onEveryTime("18:00", robot.game_auto_tasks) # 秀人网每天自动下载帖子 - robot.onEveryTime("17:30", robot.xiu_ren_download_task) + robot.onEveryTime("01:30", robot.xiu_ren_download_task) + + # 秀人网每天自动发pdf + robot.onEveryTime("17:30", robot.xiu_ren_pdf_send) + # 让机器人一直跑 robot.keepRunningAndBlockProcess() diff --git a/robot.py b/robot.py index 3a14108..08d6ccb 100644 --- a/robot.py +++ b/robot.py @@ -549,13 +549,19 @@ class Robot(Job): def xiu_ren_download_task(self): try: # 每天下载10组图,然后发一个帖子PDF - download_path = meitu_dowload_pub_pic() - path = generate_pdf_from_images(download_path) - self.wcf.send_file(path, "45317011307@chatroom") - - download_path = meitu_dowload_heisi_pic() - path = generate_pdf_from_images(download_path) - self.wcf.send_file(path, "45317011307@chatroom") + meitu_dowload_pub_pic() + meitu_dowload_heisi_pic() except Exception as e: - self.LOG.error(f"xiuren_dowload_pic error:{e}") + self.LOG.error(f"xiu_ren_download_task error:{e}") + + def xiu_ren_pdf_send(self): + try: + + pub_path = generate_pdf_from_images("xiuren") + self.wcf.send_file(pub_path, "45317011307@chatroom") + heisi_path = generate_pdf_from_images("xiuren/heisi") + self.wcf.send_file(heisi_path, "45317011307@chatroom") + + except Exception as e: + self.LOG.error(f"xiu_ren_pdf_send error:{e}")