📝 更新README及媒体库模块文档

This commit is contained in:
Cp0204 2024-11-14 02:37:20 +08:00
parent 8c0be4cf4d
commit 588a957768
2 changed files with 33 additions and 20 deletions

View File

@ -11,10 +11,10 @@
定期执行本脚本自动转存、文件名整理,配合 Alist, rclone, Emby 可达到自动追更的效果。🥳
[![wiki][wiki-image]][wiki-url] [![github tag][gitHub-tag-image]][github-url] [![docker pulls][docker-pulls-image]][docker-url] [![docker image size][docker-image-size-image]][docker-url]
[![wiki][wiki-image]][wiki-url] [![github releases][gitHub-releases-image]][github-url] [![docker pulls][docker-pulls-image]][docker-url] [![docker image size][docker-image-size-image]][docker-url]
[wiki-image]: https://img.shields.io/badge/wiki-Documents-green?logo=github
[gitHub-tag-image]: https://img.shields.io/github/v/tag/Cp0204/quark-auto-save?logo=github
[gitHub-releases-image]: https://img.shields.io/github/v/release/Cp0204/quark-auto-save?logo=github
[docker-pulls-image]: https://img.shields.io/docker/pulls/cp0204/quark-auto-save?logo=docker&&logoColor=white
[docker-image-size-image]: https://img.shields.io/docker/image-size/cp0204/quark-auto-save?logo=docker&&logoColor=white
[github-url]: https://github.com/Cp0204/quark-auto-save
@ -57,6 +57,7 @@
- 媒体库整合
- [x] 根据任务名搜索 Emby 媒体库
- [x] 追更或整理后自动刷新 Emby 媒体库
- [x] **媒体库模块化,用户可很方便地[开发自己的媒体库hook模块](./media_servers)**
- 其它
- [x] 每日签到领空间 <sup>[?](https://github.com/Cp0204/quark-auto-save/wiki/%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E9%9B%86%E9%94%A6#%E6%AF%8F%E6%97%A5%E7%AD%BE%E5%88%B0%E9%A2%86%E7%A9%BA%E9%97%B4)</sup>

View File

@ -29,23 +29,6 @@ default_config = {"url": "", "token": ""}
* `task` 是一个字典,包含任务信息。如果需要修改任务参数,返回修改后的 `task` 字典;
* 无修改则不返回或返回 `False`
## 配置文件
`quark_config.json` 中配置模块:
```json
{
"media_servers": {
"emby": {
"url": "http://your-emby-server:8096",
"token": "YOUR_EMBY_TOKEN"
}
}
}
```
当模块代码正确赋值 `default_config` 时,首次运行会自动补充缺失的键。
## 模块示例
参考 [emby.py](emby.py)
@ -69,7 +52,36 @@ try:
# ......
# 返回
except requests.exceptions.RequestException as e:
print(f"获取Emby媒体库信息出错: {e}")
print(f"Error: {e}")
return False
```
## 使用自定义模块
放到 `/media_servers` 目录即可识别,如果你使用 docker 运行:
```shell
docker run -d \
# ... 例如添加这行挂载,其它一致
-v ./quark-auto-save/media_servers/plex.py:/app/media_servers/plex.py \
# ...
```
如果你有写自定义模块的能力,相信你也知道如何挂载自定义模块,算我啰嗦。🙃
## 配置文件
`quark_config.json``media_servers` 中配置模块参数:
```json
{
"media_servers": {
"emby": {
"url": "http://your-emby-server:8096",
"token": "YOUR_EMBY_TOKEN"
}
}
}
```
当模块代码正确赋值 `default_config` 时,首次运行会自动补充缺失的键。