v1.1.0: 真实网页采集(可读正文全文入库) + 大模型接口多预置一键切换(SiliconFlow默认) + 数据源可编辑
- 新增 crawler.py: requests+bs4 readability风格清洗, 提取候选链接按文章相似度排序, 前5条抓全文存 articles.full_text, 详情页展示; example.com占位源走模拟, 真实源失败标记error不造假 - 大模型: 新增 llm_providers 表(预置 SiliconFlow/DeepSeek官方/Autodl/Local Qwen), 设置页增删改/测试/一键切换, 激活接口失败自动切换备用 - 数据源: 前端补编辑按钮+弹窗(后端 update 已支持), 列表显示URL与采集状态 - 数据库迁移: articles.full_text 列 + llm_providers 表
This commit is contained in:
+12
@@ -206,6 +206,18 @@ def _make_item(row):
|
||||
}
|
||||
|
||||
|
||||
def items_for_source(src_id, src_type=""):
|
||||
"""返回指定数据源的模拟条目(真实抓取失败/模拟源时回退用)"""
|
||||
items = []
|
||||
for row in _NEWS:
|
||||
if row[3] == int(src_id):
|
||||
it = _make_item(row)
|
||||
if src_type:
|
||||
it["domain"] = src_type
|
||||
items.append(it)
|
||||
return items
|
||||
|
||||
|
||||
def fetch_simulated():
|
||||
"""模拟一次采集:返回随机抽取的部分条目(模拟每天新增)"""
|
||||
items = []
|
||||
|
||||
Reference in New Issue
Block a user