MENU

Ubuntu安装Jellyfin并挂载Google Drive

April 24, 2022 • Read: 1032 • Index

安装 Rclone

copy
  • curl https://rclone.org/install.sh | sudo bash
  • rclone config
copy
  • No remotes found, make a new one?
  • n) New remote
  • s) Set configuration password
  • q) Quit config
  • n/s/q> This value is required and it has no default.
  • n/s/q>n //新建网盘
  • name>jellyfin
  • Storage>17 //谷歌云盘
  • client_id> //gcp控制台申请
  • client_secret> //gcp控制台申请
  • scope> 1 //完整的控制权限
  • root_folder_id> //保持默认
  • service_account_file> //同上
  • Edit advanced config?
  • y) Yes
  • n) No (default)
  • y/n>n
  • Use auto config?
  • * Say Y if not sure
  • * Say N if you are working on a remote or headless machine
  • y) Yes (default)
  • n) No
  • y/n> n
  • Enter a value.
  • config_token> //填入获取到的授权密钥(连接网盘的账户)
  • Configure this as a Shared Drive (Team Drive)?
  • y) Yes
  • n) No (default)
  • y/n>yes(团队盘选择y)
  • y) Yes this is OK (default)
  • e) Edit this remote
  • d) Delete this remote
  • y/e/d> y
  • Name                 Type
  • ====                 ====
  • plex                 drive
  • e) Edit existing remote
  • n) New remote
  • d) Delete remote
  • r) Rename remote
  • c) Copy remote
  • s) Set configuration password
  • q) Quit config
  • e/n/d/r/c/s/q> q //退出

挂载网盘到本地

copy
  • mkdir /home/gdrive
  • chmod 777 /home/gdrive

以下代码全部粘贴到命令行

copy
  • cat > /etc/systemd/system/rclone.service <<EOF
  • [Unit]
  • Description=Rclone
  • AssertPathIsDirectory=/home/gdrive
  • After=network-online.target
  • [Service]
  • Type=simple
  • ExecStart=/usr/bin/rclone mount plex: /home/gdrive \
  • --umask 0000 \
  • --default-permissions \
  • --allow-non-empty \
  • --allow-other \
  • --buffer-size 32M \
  • --dir-cache-time 12h \
  • --vfs-read-chunk-size 64M \
  • --vfs-read-chunk-size-limit 1G
  • ExecStop=/bin/fusermount -u /home/gdrive
  • Restart=on-abort
  • User=root
  • [Install]
  • WantedBy=default.target
  • EOF
copy
  • systemctl strat rclone.service //启动服务(挂载到本地)
  • systemctl enable rclone.service //开机启动

常用命令

copy
  • systemctl strat rclone.service //启动服务(挂载到本地)
  • fusermount -u /home/gdrive //取消挂载
  • systemctl status rclone.service -l //查询运行状态
  • systemctl stop rclone.service //停止服务
  • systemctl restrat rclone.service //重启服务
  • systemctl enable rclone.service //开机启动
  • systemctl disable rclone.service //取消开机启动

安装 Jellyfin

copy
  • sudo apt install apt-transport-https
  • wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo apt-key add -
  • echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
  • sudo apt update
  • sudo apt install jellyfin
  • //root用户下可删除sudo
copy
  • 重启程序:service jellyfin restart
  • 查看状态:service jellyfin status
  • 开机自启:systemctl enable jellyfin
  • //通过ip:8096访问该媒体库了,端口可以在程序面板内修改
Archives QR Code Tip
QR Code for this page
Tipping QR Code
歌曲封面
潮湿的心 - 小阿枫
0:00