1.加入了指令;

2.判断接收人从redis+本地缓存中提取;
3.做本地缓存与redis实时同步;
This commit is contained in:
liuwei
2025-02-17 13:02:01 +08:00
parent cf01ed97f7
commit af2ef96c3e
4 changed files with 294 additions and 26 deletions

View File

@@ -74,7 +74,6 @@ def fetch_and_create_pdf(url):
# 获取今天的日期
today = datetime.now().strftime('%Y-%m-%d')
# 注册中文字体
pdfmetrics.registerFont(TTFont('SamHei', 'fonts/simhei.ttf')) # 设置中文字体路径
styles = getSampleStyleSheet()
@@ -170,7 +169,6 @@ 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}")
@@ -202,12 +200,12 @@ def add_pdf_encryption(pdf_file, password="4000"):
print(f"PDF加密成功密码为: {password}")
def pdf_file_path():
url = 'https://www.sehuatang.net/forum.php?mod=forumdisplay&fid=103&filter=typeid&typeid=481'
pdf_path = fetch_and_create_pdf(url)
print(f"返回的PDF文件路径{pdf_path}")
return pdf_path
if __name__ == "__main__":
pdf_file_path()