基本流程如下

  1. 备份
  2. 部署aliyun-webdav
  3. 部署rclone
  4. 配置Jelyfin aliyundrive-webdav

通过在线工具获取 refresh token

  1. 暴露阿里云盘API 使得他能通过webdav的方式访问

  2. 因为Jellyfin不支持直接访问WebDav, 所以需要中间层, 之前别人是通过rclone来实现的, 但是我觉得太复杂了, 后来看到了aliyundrive-fuse, 但是阿里云盘改了API原作者懒得改了, 直接archive了项目. 所以又回到了rclone

  3. 群晖的奇怪设计导致rclone 总是起不来, 思索再三, 决定用虚拟机直接上一个.

配置webdav 和rclone

1
rclone config
1
2
3
4
   #新建本地文件夹,位置可以自己选
   mkdir /data/aliyunwebdav
   #挂载
   rclone mount DriveName:Folder LocalFolder --cache-dir /tmp --allow-other --vfs-cache-mode writes --allow-non-empty

DriverName是你在配置rclone的时候设置的名字,Folder没有需要求的话填/即可,LocalFolder是你本地挂载的地址,/tmp比较特殊,上传时缓存目录,其他类型挂载一般时不需要这个参数的,默认/tmp地址即可.

aliyunDrive rclone mount aliyunDrive:Jellfin/ aliyunwebdav –cache-dir /tmp –allow-other –vfs-cache-mode writes –allow-non-empty

1
2
3
mkdir /data/aliyundrive
sudo apt install fuse #安装FUSE
rclone mount aliyundrive:Jellfin/ aliyundrive --cache-dir /tmp --allow-other --vfs-cache-mode writes --allow-non-empty

设置开机自启动

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
   #将后面修改成你上面手动运行命令中,除了rclone的全部参数
   command="mount DriveName:Folder LocalFolder --cache-dir /tmp --allow-other --vfs-cache-mode writes --allow-non-empty"
   #以下是一整条命令,一起复制到SSH客户端运行
   cat > /etc/systemd/system/rclone.service <<EOF
   [Unit]
   Description=Rclone
   After=network-online.target
   [Service]
   Type=simple
   ExecStart=$(command -v rclone) ${command}
   Restart=on-abort
   User=root
   [Install]
   WantedBy=default.target
   EOF
1
2
   systemctl start rclone #启动rclone
   systemctl enable rclone #添加自动启动