下图和发pdf分离

This commit is contained in:
liuwei
2025-02-27 16:54:50 +08:00
parent 9bee369c60
commit 7929f550b4
2 changed files with 19 additions and 9 deletions

View File

@@ -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()

View File

@@ -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}")