前言
本文将解决使用网盘挂载的plex媒体库不能实时刷新的问题,使用autoscan配合a-train做到plex媒体实时小范围刷新,而不是每次扫描整个媒体库。
安装docker-compose
首先安装docker
1 2 3
| apt-get update apt-get install -y wget sudo curl curl -fsSL https://get.docker.com | bash -s docker #安装docker
|
安装docker-compose
1 2 3
| sudo curl -L "https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose #下载 Compose sudo chmod +x /usr/local/bin/docker-compose #添加权限 sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose #创建软链
|
创建docker-compose.yml
在/autoscan/目录下创建名为docker-compose.yml的文件,内容如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| version: '3' services: autoscan: image: cloudb0x/autoscan:latest restart: unless-stopped volumes: - ./config:/config - /mnt/gd:/mnt/gd:ro ports: - 3030:3030 networks: - asnetwork environment: TZ: Asia/Shanghai PLEX_UID: 1000 PLEX_GID: 1001
a-train: image: ghcr.io/m-rots/a-train:latest restart: unless-stopped networks: - asnetwork volumes: - ./data:/data depends_on: - autoscan environment: TZ: Asia/Shanghai
networks: asnetwork:
|
在需要监控的网盘目录下建立一个名为1.anchor标靶空文件
存放一个sa文件到/autoscan/data目录下并命名为account.json
修改/autoscan/data目录下a-train的配置文件a-train.toml如下
1 2 3 4 5 6 7 8
| [autoscan] url = "" username = "hello dom" password = "general dom password"
[drive] account = "./account.json" drives = [""]
|
修改/autoscan/config目录下autoscan的配置文件config.yml如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| minimum-age: 3m scan-delay: 15s scan-stats: 5m
anchors: - /mnt/gd/1.anchor
authentication: username: hello dom password: general dom password
port: 3030
triggers: a-train: priority: 5 rewrite: - from: ^/ to: /mnt/gd/
targets: plex: - url: token:
|
最后启动docker compose