调整文件生成目录,加入一个JAV

This commit is contained in:
liuwei
2026-01-14 15:43:05 +08:00
parent 20624f39e1
commit 9b2952d8df
2 changed files with 13 additions and 8 deletions

View File

@@ -117,9 +117,11 @@ def fetch_and_create_pdf(url):
normal_style = styles['Normal']
normal_style.fontName = 'SimHei'
# 路径逻辑
save_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'temp')
if not os.path.exists(save_path): os.makedirs(save_path)
# 路径逻辑 - 保存到 temp/JAV 目录
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
save_path = os.path.join(base_dir, 'temp', 'JAV')
if not os.path.exists(save_path):
os.makedirs(save_path)
pdf_filename = os.path.join(save_path, f"JAV-{datetime.now().strftime('%Y-%m-%d')}-{len(today_posts)}.pdf")
doc = SimpleDocTemplate(pdf_filename, pagesize=A3)