mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
change newsnow plugin doc
This commit is contained in:
@@ -28,8 +28,9 @@ plugins:
|
||||
baidu: "百度热搜"
|
||||
cls-depth: "财联社"
|
||||
# 可以添加更多新闻源
|
||||
sina: "新浪新闻"
|
||||
sohu: "搜狐新闻"
|
||||
weibo: "微博头条"
|
||||
douyin: "抖音热搜"
|
||||
solidot: "奇客Solidot"
|
||||
```
|
||||
|
||||
## 新闻源配置格式
|
||||
@@ -50,8 +51,9 @@ plugins:
|
||||
"thepaper": "澎湃新闻",
|
||||
"baidu": "百度热搜",
|
||||
"cls-depth": "财联社",
|
||||
"sina": "新浪新闻",
|
||||
"sohu": "搜狐新闻"
|
||||
"weibo": "微博头条",
|
||||
"douyin": "抖音热搜",
|
||||
"solidot": "奇客Solidot"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -79,29 +81,4 @@ plugins:
|
||||
1. 新闻源的 `source_id` 必须与API接口支持的ID一致
|
||||
2. 配置更改后需要重启服务或重新加载配置
|
||||
3. 如果配置的新闻源无效,插件会自动使用默认新闻源
|
||||
4. JSON格式必须正确,否则会使用默认配置
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 问题:配置的新闻源不生效
|
||||
|
||||
**解决方案**:
|
||||
1. 检查JSON格式是否正确
|
||||
2. 确认新闻源ID是否有效
|
||||
3. 查看日志文件中的错误信息
|
||||
4. 重启服务
|
||||
|
||||
### 问题:无法获取新闻
|
||||
|
||||
**解决方案**:
|
||||
1. 检查网络连接
|
||||
2. 确认API接口地址是否正确
|
||||
3. 查看API接口是否可用
|
||||
4. 检查日志文件中的错误信息
|
||||
|
||||
## 技术实现
|
||||
|
||||
- 插件会从 `conn.config["plugins"]["get_news_from_newsnow"]["news_sources"]` 读取配置
|
||||
- 支持字符串格式的JSON和字典格式的配置
|
||||
- 配置验证和错误处理机制
|
||||
- 向后兼容,未配置时使用默认值
|
||||
4. JSON格式必须正确,否则会使用默认配置
|
||||
Reference in New Issue
Block a user