加入分页,逆序排列帖子
This commit is contained in:
@@ -84,6 +84,7 @@ def fetch_and_create_pdf(url):
|
|||||||
|
|
||||||
normal_style = styles['Normal']
|
normal_style = styles['Normal']
|
||||||
normal_style.fontName = 'SimHei'
|
normal_style.fontName = 'SimHei'
|
||||||
|
normal_style.fontSize = 13
|
||||||
|
|
||||||
content = []
|
content = []
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@ def fetch_and_create_pdf(url):
|
|||||||
# 添加磁力链接
|
# 添加磁力链接
|
||||||
if magnet_links:
|
if magnet_links:
|
||||||
for magnet_link in magnet_links:
|
for magnet_link in magnet_links:
|
||||||
content.append(Paragraph(f"<br /><br /><b>{magnet_link}</b><br /><br />", normal_style))
|
content.append(Paragraph(f"<br /><b>{magnet_link}</b><br />", normal_style))
|
||||||
content.append(Spacer(1, 12))
|
content.append(Spacer(1, 12))
|
||||||
|
|
||||||
# 添加图片
|
# 添加图片
|
||||||
@@ -148,7 +149,7 @@ def fetch_and_create_pdf(url):
|
|||||||
image_height = int((img_height / img_width) * image_width)
|
image_height = int((img_height / img_width) * image_width)
|
||||||
img_stream = BytesIO(image.getvalue())
|
img_stream = BytesIO(image.getvalue())
|
||||||
content.append(Image(img_stream, width=image_width, height=image_height))
|
content.append(Image(img_stream, width=image_width, height=image_height))
|
||||||
content.append(Spacer(1, 12))
|
content.append(Spacer(1, 4))
|
||||||
|
|
||||||
# 在每个帖子后添加分页符(除了最后一页)
|
# 在每个帖子后添加分页符(除了最后一页)
|
||||||
if post != today_posts[-1]:
|
if post != today_posts[-1]:
|
||||||
|
|||||||
Reference in New Issue
Block a user