modify scripts

This commit is contained in:
oscarz
2025-04-05 17:26:30 +08:00
parent 0944d4f1c3
commit 41124caab1

View File

@ -120,7 +120,7 @@ def write_raw_html(href, html_text):
# 保存抓取到的原始HTML方便后续核验
def read_raw_html(href, expire_date="2025-03-01"):
def read_raw_html(href, expire_date_str="2025-03-01"):
# 获取目录
id = extract_id_from_href(href)
if 'person.rme' in href.lower():
@ -141,6 +141,7 @@ def read_raw_html(href, expire_date="2025-03-01"):
# 将时间戳转换为 datetime 对象
last_modified_date = datetime.fromtimestamp(last_modified_timestamp)
# 检查文件最后修改时间是否晚于给定日期
expire_date = datetime.strptime(expire_date_str, "%Y-%m-%d")
if last_modified_date > expire_date:
logging.debug(f"find local file on href {href}")
with open(full_path, 'r', encoding='utf-8') as file: