Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
C5H12O5 committed Jan 24, 2024
2 parents d73e3fb + 5e17835 commit 27cc22b
Show file tree
Hide file tree
Showing 13 changed files with 400 additions and 39 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub Release](https://img.shields.io/github/v/release/C5H12O5/syno-videoinfo-plugin?logo=github&style=flat&color=blue)](https://github.com/C5H12O5/syno-videoinfo-plugin/releases)
![GitHub Stars](https://img.shields.io/github/stars/C5H12O5/syno-videoinfo-plugin?logo=github&style=flat&color=yellow)
![GitHub Downloads](https://img.shields.io/github/downloads/C5H12O5/syno-videoinfo-plugin/total?logo=github&style=flat&color=green)
![Python Support](https://img.shields.io/badge/Python-3.7+-green?logo=python&style=flat&color=steelblue)
![Python Support](https://img.shields.io/badge/Python-3.6+-green?logo=python&style=flat&color=steelblue)
[![GitHub License](https://img.shields.io/github/license/C5H12O5/syno-videoinfo-plugin?logo=apache&style=flat&color=lightslategray)](LICENSE)

###### 📖 English / 📖 [简体中文](README.zh-CN.md)
Expand All @@ -30,15 +30,16 @@ Configure the plugin:
1. Open your browser, go to `http://[NAS_IP]:5125` (replace `[NAS_IP]` with your NAS IP address) page.
2. Change the configuration as you want, and click **[ :floppy_disk: ]** button in the upper right corner.
3. Go back to your **Video Station**, the configuration should be applied automatically.
* **[Note :warning: ]** If you upgrade the plugin but the configuration page is not updated, you can restart the configuration service by following steps:
1. Open the configuration page, click **[Exit]** button in the upper right corner to close the service.
2. Go back to **Video Station**, go to ***Settings*** > ***Video Info Plugin***, and click **[Test Connection]** button to restart the service.
> [!NOTE]
> If you upgrade the plugin but the configuration page is not updated, you can restart the configuration service by following steps:
> 1. Open the configuration page, click **[Exit]** button in the upper right corner to close the service.
> 2. Go back to **Video Station**, go to ***Settings*** > ***Video Info Plugin***, and click **[Test Connection]** button to restart the service.
## Requirements

* Python 3.7+
* DSM 7.0+
* Video Station 3.0.0+
* Python 3.6+
* Video Station 2.5.0+ for DSM 6.0
* Video Station 3.0.0+ for DSM 7.0

## References

Expand All @@ -62,19 +63,19 @@ You can develop your own plugin based on this project easily. Here are the steps

1. Clone this repository to your local machine:

```sh
```shell
git clone https://github.com/C5H12O5/syno-videoinfo-plugin
```

2. Modify the code as you want, and test it like this:

```sh
```shell
python main.py --type movie --input "{\"title\":\"{movie_title}\"}" --limit 1 --loglevel debug
```

3. Package the plugin using the following command:

```sh
```shell
python setup.py sdist --formats=zip
```

Expand Down
21 changes: 11 additions & 10 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub Release](https://img.shields.io/github/v/release/C5H12O5/syno-videoinfo-plugin?logo=github&style=flat&color=blue)](https://github.com/C5H12O5/syno-videoinfo-plugin/releases)
![GitHub Stars](https://img.shields.io/github/stars/C5H12O5/syno-videoinfo-plugin?logo=github&style=flat&color=yellow)
![GitHub Downloads](https://img.shields.io/github/downloads/C5H12O5/syno-videoinfo-plugin/total?logo=github&style=flat&color=green)
![Python Support](https://img.shields.io/badge/Python-3.7+-green?logo=python&style=flat&color=steelblue)
![Python Support](https://img.shields.io/badge/Python-3.6+-green?logo=python&style=flat&color=steelblue)
[![GitHub License](https://img.shields.io/github/license/C5H12O5/syno-videoinfo-plugin?logo=apache&style=flat&color=lightslategray)](LICENSE)

###### 📖 [English](README.md) / 📖 简体中文
Expand All @@ -29,15 +29,16 @@
1. 打开你的浏览器,输入`http://[NAS_IP]:5125`(将`[NAS_IP]`替换为你的NAS的IP地址)打开配置页面。
2. 根据你的需要修改配置,然后点击右上角的 **[ :floppy_disk: ]** 按钮。
3. 返回你的 **Video Station**,保存的配置将会自动生效。
* **[注意 :warning: ]** 如果升级了插件但是配置页面没有更新,可以通过以下步骤来重启配置服务:
1. 打开配置页面,点击右上角的 **[Exit]** 按钮关闭配置服务。
2. 返回 **Video Station**,进入 ***设置*** > ***视频信息插件***,点击 **[测试连接]** 按钮即可重新启动配置服务。
> [!NOTE]
> 如果升级了插件但是配置页面没有更新,可以通过以下步骤来重启配置服务:
> 1. 打开配置页面,点击右上角的 **[Exit]** 按钮关闭配置服务。
> 2. 返回 **Video Station**,进入 ***设置*** > ***视频信息插件***,点击 **[测试连接]** 按钮即可重新启动配置服务。
## 版本要求

* Python 3.7+
* DSM 7.0+
* Video Station 3.0.0+
* Python 3.6+
* Video Station 2.5.0+(DSM 6.0)
* Video Station 3.0.0+(DSM 7.0)

## 参考文献

Expand All @@ -61,19 +62,19 @@

1. 将本项目克隆到本地:

```sh
```shell
git clone https://github.com/C5H12O5/syno-videoinfo-plugin
```

2. 根据需要修改代码,并可以使用以下命令进行测试:

```sh
```shell
python main.py --type movie --input "{\"title\":\"{movie_title}\"}" --limit 1 --loglevel debug
```

3. 然后可以使用以下命令进行打包并上传使用:

```sh
```shell
python setup.py sdist --formats=zip
```

Expand Down
Binary file modified preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions scrapeflows/bangumi_movie.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"type": "movie",
"site": "bangumi.tv",
"steps": [
{
"doh": {
"host": "api.bgm.tv"
}
},
{
"http": {
"url": "https://api.bgm.tv/search/subject/{title}?type=2&start=0&max_results={limit}",
"method": "GET",
"headers": {
"User-Agent": "C5H12O5/syno-videoinfo-plugin{version} (https://github.com/C5H12O5/syno-videoinfo-plugin)"
},
"result": "metadata"
}
},
{
"collect": {
"source": "metadata",
"into": {
"ids": "['xp_texts', './list//id']"
}
}
},
{
"loop": {
"source": "ids",
"item": "id",
"steps": [
{
"http": {
"url": "https://api.bgm.tv/v0/subjects/{id}",
"method": "GET",
"headers": {
"User-Agent": "C5H12O5/syno-videoinfo-plugin{$parent[version]} (https://github.com/C5H12O5/syno-videoinfo-plugin)"
},
"result": "subject"
}
},
{
"collect": {
"source": "subject",
"into": {
"movie": {
"title": "['xp_text', './name_cn']",
"tagline": "['xp_text', './name']",
"original_available": "['xp_text', './date']",
"summary": "['xp_text', './summary']",
"certificate": "",
"genre": "['xp_texts', './tags//name']",
"actor": [],
"writer": "['re_matches', '\"key\":\"原作\",\"value\":\"([^\"]*?)\"']",
"director": "['re_matches', '\"key\":\"导演\",\"value\":\"([^\"]*?)\"']",
"extra": {
"[plugin_id]": {
"rating": {
"[plugin_id]": "['xp_text', './rating//score', 'float']"
},
"poster": [
"['xp_text', './images//large']"
],
"backdrop": [
"['xp_text', './images//large']"
]
}
}
},
"publish_date": "['xp_text', './date']",
"available_date": "{$parent[available]}"
}
}
},
{
"http": {
"url": "https://api.bgm.tv/v0/subjects/{id}/characters",
"method": "GET",
"headers": {
"User-Agent": "C5H12O5/syno-videoinfo-plugin{$parent[version]} (https://github.com/C5H12O5/syno-videoinfo-plugin)"
},
"result": "characters"
}
},
{
"collect": {
"source": "characters",
"into": {
"movie": {
"actor": "['xp_texts', './/actors//name']"
}
}
}
},
{
"retval": {
"source": "movie",
"compare": "['publish_date', '>=', 'available_date']"
}
}
]
}
}
]
}
77 changes: 77 additions & 0 deletions scrapeflows/bangumi_tvshow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"type": "tvshow",
"site": "bangumi.tv",
"steps": [
{
"doh": {
"host": "api.bgm.tv"
}
},
{
"http": {
"url": "https://api.bgm.tv/search/subject/{title}?type=2&start=0&max_results={limit}",
"method": "GET",
"headers": {
"User-Agent": "C5H12O5/syno-videoinfo-plugin{version} (https://github.com/C5H12O5/syno-videoinfo-plugin)"
},
"result": "metadata"
}
},
{
"collect": {
"source": "metadata",
"into": {
"ids": "['xp_texts', './list//id']"
}
}
},
{
"loop": {
"source": "ids",
"item": "id",
"steps": [
{
"http": {
"url": "https://api.bgm.tv/v0/subjects/{id}",
"method": "GET",
"headers": {
"User-Agent": "C5H12O5/syno-videoinfo-plugin{$parent[version]} (https://github.com/C5H12O5/syno-videoinfo-plugin)"
},
"result": "subject"
}
},
{
"collect": {
"source": "subject",
"into": {
"tvshow": {
"title": "['xp_text', './name_cn']",
"original_available": "['xp_text', './date']",
"summary": "['xp_text', './summary']",
"extra": {
"[plugin_id]": {
"poster": [
"['xp_text', './images//large']"
],
"backdrop": [
"['xp_text', './images//large']"
]
}
}
},
"publish_date": "['xp_text', './date']",
"available_date": "{$parent[available]}"
}
}
},
{
"retval": {
"source": "tvshow",
"compare": "['publish_date', '>=', 'available_date']"
}
}
]
}
}
]
}
Loading

0 comments on commit 27cc22b

Please sign in to comment.