加入4K群文件PDF文件发送功能

This commit is contained in:
liuwei
2025-02-08 14:50:35 +08:00
parent 30c6ac6466
commit bb714a794a
3 changed files with 27 additions and 7 deletions

View File

@@ -175,18 +175,24 @@ def fetch_and_create_pdf(url):
# 生成PDF
doc.build(content)
# 获取PDF文件的绝对路径
absolute_pdf_path = os.path.abspath(pdf_filename)
print(f"PDF saved as {absolute_pdf_path}")
# 加密PDF
add_pdf_encryption(absolute_pdf_path)
# 关闭浏览器
driver.quit()
print(f"PDF saved as {pdf_filename}")
return absolute_pdf_path
# 加密PDF
add_pdf_encryption(pdf_filename)
return pdf_filename
def main():
def pdf_file_path():
url = 'https://www.sehuatang.net/forum.php?mod=forumdisplay&fid=103&filter=typeid&typeid=481'
return fetch_and_create_pdf(url)
pdf_path = fetch_and_create_pdf(url)
print(f"返回的PDF文件路径{pdf_path}")
return pdf_path
if __name__ == "__main__":
main()
pdf_file_path()