加入分页,逆序排列帖子
This commit is contained in:
@@ -124,13 +124,13 @@ def fetch_and_create_pdf(url):
|
|||||||
|
|
||||||
# 添加标题
|
# 添加标题
|
||||||
content.append(Paragraph(f" {post_title}", title_style))
|
content.append(Paragraph(f" {post_title}", title_style))
|
||||||
content.append(Spacer(1, 12))
|
content.append(Spacer(1, 5))
|
||||||
|
|
||||||
# 添加磁力链接
|
# 添加磁力链接
|
||||||
if magnet_links:
|
if magnet_links:
|
||||||
for magnet_link in magnet_links:
|
for magnet_link in magnet_links:
|
||||||
content.append(Paragraph(f"<br /><b>{magnet_link}</b><br />", normal_style))
|
content.append(Paragraph(f"<br /><b>{magnet_link}</b><br />", normal_style))
|
||||||
content.append(Spacer(1, 12))
|
content.append(Spacer(1, 5))
|
||||||
|
|
||||||
# 添加图片
|
# 添加图片
|
||||||
image_links = []
|
image_links = []
|
||||||
@@ -145,7 +145,7 @@ def fetch_and_create_pdf(url):
|
|||||||
if image:
|
if image:
|
||||||
img = PILImage.open(image)
|
img = PILImage.open(image)
|
||||||
img_width, img_height = img.size
|
img_width, img_height = img.size
|
||||||
image_width = 500
|
image_width = 450
|
||||||
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))
|
||||||
|
|||||||
Reference in New Issue
Block a user