From 7929f550b43c3f1b5abf8cb4e9c6ed4241bb5ccb Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 27 Feb 2025 16:54:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E5=9B=BE=E5=92=8C=E5=8F=91pdf?= =?UTF-8?q?=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 +++++- robot.py | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) 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}")