当『Emby、Plex、Jellyfin』遇上『阿里云盘』
此教程默认你已经自己搭建过 Emby、Plex、Jellyfin 等流媒体服务,所以不会对搭建流媒体服务做讲解
三步走
- 阿里云盘配置 Webdav 服务
- 通过 rclone 将阿里云盘挂载到本地
- 流媒体服务(Emby、Plex、Jellyfin)配置媒体库
配置阿里云盘 Webdav 服务
这部分内容可以看这篇博客:当 Infuse 遇上阿里云盘(opens new window)
rclone 挂载阿里云盘
使用的 docker 镜像:mumiehub/rclone-mount(opens new window)
使用 docker-compose
创建 docker-compose.yml 文件
version: '3'
services:
rclone-aliyun:
image: mumiehub/rclone-mount
container_name: rclone-aliyun
restart: always
cap_add:
- SYS_ADMIN
devices:
- /dev/fuse
security_opt:
- apparmor:unconfined
volumes:
- <your path>/rclone-aliyun/config:/root/.config/rclone
- <your path>/rclone-aliyun/aliyun:/mnt/mediaefs:shared
environment:
- RemotePath=<your remote path>
- ConfigDir=/root/.config/rclone
- ConfigName=rclone.conf
- MountCommands=--allow-other --allow-non-empty
docker-compose.yml 解释
配置项 | 解释 |
---|---|
/root/.config/rclone | rclone 配置文件位置,文件名为 rclone.conf |
/mnt/mediaefs:shared | 挂载盘位置 |
RemotePath | aliyun:movie,aliyun 是挂载名,movie 是网盘中的地址 |
其他的配置可以不用变
创建 rclone.conf 配置文件
创建配置文件有两种方式:
- 在已安装有 rclone 的机器上创建配置文件
- 进入容器内部创建
我们这边选择第二种方式
进入容器内部
docker exec -it rclone-aliyun sh
创建配置
输入命令 rclone config
后出现这个界面
e) Edit existing remote # 编辑已有的远程挂载点 | |
n) New remote # 新挂载 | |
d) Delete remote # 删除挂载 | |
r) Rename remote # 重命名挂载 | |
c) Copy remote # 为已有挂载建立一个副本 | |
s) Set configuration password # 设置配置密码 | |
q) Quit config # 退出配置 | |
# 输入 n 创建新的挂载 |
输入 n
创建新的挂载
name> # 给你的挂载取个名字,这里我取的是 aliyun
然后会出现一堆选项,让我们选择类别,这里我们输入 webdav
Storage> webdav
URL of http host to connect to | |
Enter a string value. Press Enter for the default (""). | |
Choose a number from below, or type in your own value | |
1 / Connect to example.com | |
"https://example.com" | |
# 输入服务商给的 webdav 地址,如我的地址是 http://home-linx:1234 |
Name of the Webdav site/service/software you are using | |
Enter a string value. Press Enter for the default (""). | |
Choose a number from below, or type in your own value | |
1 / Nextcloud | |
"nextcloud" | |
2 / Owncloud | |
"owncloud" | |
3 / Sharepoint | |
"sharepoint" | |
4 / Other site/service or software | |
"other" | |
# 输入类型,这里我们输入 other |
User name | |
Enter a string value. Press Enter for the default (""). | |
# 输入 webdav 服务的用户名 |
Password. | |
y) Yes type in my own password | |
g) Generate random password | |
n) No leave this optional password blank (default) | |
# 输入 y 之后输入密码,并确认密码 |
Bearer token instead of user/pass (eg a Macaroon) | |
Enter a string value. Press Enter for the default (""). | |
# 输入一个口令用来代替输入繁琐的密码 |
Edit advanced config? (y/n) | |
y) Yes | |
n) No (default) | |
# 这里可以直接回车 |
最后确认配置项,输入 q 退出即可。
重启容器
docker-compose restart # 或者 docker-compose up --force-recreate -d
检验是否挂载成功
- 进入挂载的文件夹,查看是否有内容
- 输入命令
df -h
,查看是否多了一个容量为 1PB 的磁盘
流媒体软件添加媒体库
我们这里以 Jellyfin
为例,Emby
和 Plex
是类似的 在媒体库设置中将文件库的位置选择挂载好的阿里网盘即可,然后就正常的扫描搜刮 搜刮完之后,Jellyfin
可以正常显示,阿里云盘中也有相应的文件