diff --git a/sehuatang/shehuatang.py b/sehuatang/shehuatang.py index c7e10b8..41a8304 100644 --- a/sehuatang/shehuatang.py +++ b/sehuatang/shehuatang.py @@ -129,18 +129,18 @@ def fetch_and_create_pdf(url): magnet_links = re.findall(r'magnet:\?[^ ]+', post_text) # 使用正则表达式查找磁力链接 # 添加标题到PDF - content.append(Paragraph(f"标题: {post_title}", title_style)) + content.append(Paragraph(f"标题:\n {post_title}", title_style)) content.append(Spacer(1, 12)) - content.append(Paragraph(f"来源URL: {post_page_url}", normal_style)) + content.append(Paragraph(f"来源URL:\n {post_page_url}\n", normal_style)) content.append(Spacer(1, 12)) - content.append(Paragraph(f"介绍: {post_text}", normal_style)) + content.append(Paragraph(f"介绍:\n {post_text}\n", normal_style)) content.append(Spacer(1, 12)) # 添加空白区域 # 如果有磁力链接,将其单独加粗并显示 if magnet_links: for magnet_link in magnet_links: # 将磁力链接作为加粗的内容显示 - content.append(Paragraph(f"Magnet Link: {magnet_link}", normal_style)) + content.append(Paragraph(f"Magnet Link:\n {magnet_link}\n\n", normal_style)) content.append(Spacer(1, 12)) # 添加空白区域 # 添加图片