|
@@ -1,12 +1,12 @@
|
|
|
"""供给域工具函数 —— API 响应解析、数据转换、搜索/账号/文章通用工具"""
|
|
"""供给域工具函数 —— API 响应解析、数据转换、搜索/账号/文章通用工具"""
|
|
|
|
|
|
|
|
-import hashlib
|
|
|
|
|
import logging
|
|
import logging
|
|
|
import re
|
|
import re
|
|
|
from datetime import datetime
|
|
from datetime import datetime
|
|
|
from typing import Dict, List, Tuple
|
|
from typing import Dict, List, Tuple
|
|
|
from urllib.parse import parse_qs, urlparse
|
|
from urllib.parse import parse_qs, urlparse
|
|
|
|
|
|
|
|
|
|
+from src.infra.shared.tools import str_to_md5
|
|
|
from src.infra.spider.wechat.gzh import get_article_list_from_account
|
|
from src.infra.spider.wechat.gzh import get_article_list_from_account
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
logger = logging.getLogger(__name__)
|
|
@@ -94,7 +94,7 @@ def parse_search_result(
|
|
|
"wx_sn": extract_wx_sn(article_url) or "",
|
|
"wx_sn": extract_wx_sn(article_url) or "",
|
|
|
"biz": extract_biz(article_url) or "",
|
|
"biz": extract_biz(article_url) or "",
|
|
|
"title": title,
|
|
"title": title,
|
|
|
- "title_md5": hashlib.md5(title.encode("utf-8")).hexdigest() if title else "",
|
|
|
|
|
|
|
+ "title_md5": str_to_md5(title) if title else "",
|
|
|
"cover_url": article.get("cover_url", ""),
|
|
"cover_url": article.get("cover_url", ""),
|
|
|
"publish_time": publish_time,
|
|
"publish_time": publish_time,
|
|
|
}
|
|
}
|