From 41124caab1e4e30d068d9cba30df6debd6df31ca Mon Sep 17 00:00:00 2001 From: oscarz Date: Sat, 5 Apr 2025 17:26:30 +0800 Subject: [PATCH] modify scripts --- iafd/src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iafd/src/utils.py b/iafd/src/utils.py index 59aeaae..98ac479 100644 --- a/iafd/src/utils.py +++ b/iafd/src/utils.py @@ -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: