feat: 军事科技每日资讯推送系统 - Docker部署 + 日志系统 + 数据目录重组
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""直接基于已有的网摘TXT重新生成图片,验证字体修复"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'scripts'))
|
||||
from datetime import datetime
|
||||
from modules.image_generator import create_combined_webzine_image
|
||||
|
||||
# 读取已有的网摘TXT
|
||||
txt_path = "output/military_webzine_20260512.txt"
|
||||
with open(txt_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# 提取3篇网摘文本(去掉顶部标题,按"="分割)
|
||||
sections = content.split('==============================================================')
|
||||
webzine_texts = []
|
||||
for i in range(1, len(sections), 2):
|
||||
if i+1 < len(sections):
|
||||
webzine = sections[i+1].split('\n🔗 原文链接')[0].strip()
|
||||
webzine_texts.append(webzine)
|
||||
|
||||
now = datetime.strptime('2026-05-12', '%Y-%m-%d')
|
||||
output_path = "output/military_webzine_20260512_fixed.png"
|
||||
|
||||
# 重新生成图片
|
||||
create_combined_webzine_image(webzine_texts, output_path, now)
|
||||
print(f"修复后的图片已生成: {output_path}")
|
||||
Reference in New Issue
Block a user