H5ai + Plexdrive用于列出Google Drive的文件

in Technique with 0 comment and 1183 read

1 H5ai安装

index index.html index.php /_h5ai/public/index.php;

2 Plexdrive挂载Google Drive

Google Drive

Plexdrive

wget https://github.com/dweidenfeld/plexdrive/releases/download/5.1.0/plexdrive-linux-amd64
mv plexdrive-linux-amd64 /usr/local/bin/plexdrive
chmod +x /usr/local/bin/plexdrive
mkdir /path/to/H5ai/gdrive

/usr/local/bin/plexdrive mount \
 -c /home/.plexdrive \
 -o allow_other \
 -v 4 --refresh-interval=1m \
 --chunk-check-threads=4 \
 --chunk-load-threads=4 \
 --chunk-load-ahead=4 \
 --drive-id=123456789abcdeg \
 --max-chunks=20 \
/path/to/H5ai/gdrive

# 需要更改其中H5ai的路径
# drive-id 为Team Drive的ID,即浏览器打开该Team Drive时网址中 /folders/ 后面的一串ID
# 第一次运行挂载命令要求输入之前获取的ID和KEY,同时返回一个授权网址,打开授权网址,复制获得的授权Token到终端

开机挂载

cat > /etc/systemd/system/plexdrive.service <<EOF
[Unit]
Description=Plexdrive
AssertPathIsDirectory=/path/to/H5ai/gdrive
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/plexdrive mount \
 -c /home/.plexdrive \
 -o allow_other \
 -v 4 --refresh-interval=1m \
 --chunk-check-threads=4 \
 --chunk-load-threads=4 \
 --chunk-load-ahead=4 \
 --drive-id=123456789abcdeg \
 --max-chunks=20 \
/path/to/H5ai/gdrive
ExecStop=/bin/fusermount -u /home/gdrive
Restart=on-abort

[Install]
WantedBy=default.target
EOF

systemctl start plexdrive
systemctl enable plexdrive