当前位置:   article > 正文

Ubuntu搭建EMBY和挂载Google Drive_ubuntu emby

ubuntu emby

Ubuntu搭建EMBY和挂载Google Drive

1、安装emby

使用谷歌云ubuntu-1804系统,e2-medium(2 个 vCPU,4 GB 内存)
首先SSH连接实例
获得超级权限

sudo -i
  • 1

下载emby:

wget https://github.com/MediaBrowser/Emby.Releases/releases/download/4.5.3.0/emby-server-deb_4.5.3.0_amd64.deb
  • 1

安装emby:

dpkg -i emby-server-deb_4.5.3.0_amd64.deb
  • 1

安装完成后,浏览器输入IP:8096,即可访问
如:xxx.xxx.xxx.xxx:8096
如果你还是打不开,那可能是因为端口未开放的缘故, Ubuntu系统下打开端口 iptables -F

设置开机启动emby-server:

systemctl enable emby-server
  • 1

(启动emby-server的命令:systemctl start emby-server,重启后网站打不开使用)
启动emby线程:

systemctl start emby-server.service
  • 1

结束emby线程:

systemctl stop emby-server.service
  • 1

访问emby:
xxx.xxx.xxx.xxx:8096
欢迎页
然后刷新一下网页即可变成中文
接着设置登录的账号密码:
在这里插入图片描述
往后自行设置即可

2、挂载Google Drive

1、安装rclone

curl https://rclone.org/install.sh | sudo bash
  • 1

2、配置

rclone config
  • 1
o remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

name> video 可以随意取 但是后面的代码也会相应改变,后面挂载到本地需要用到
--------------------------------------------------------------
Choose a number from below, or type in your own value
选谷歌 (13) 可能会因为版本的不同而改变 注意选择 Google drive
--------------------------------------------------------------
client_id> 直接回车
--------------------------------------------------------------
client_secret> 直接回车
--------------------------------------------------------------
Choose a number from below, or type in your own value
scope> 11 有最大的使用权限。
--------------------------------------------------------------
ID of the root folder
Leave blank normally.

Fill in to access "Computers" folders (see docs), or for rclone to use
a non root folder as its starting point.

Note that if this is blank, the first time rclone runs it will fill it
in with the ID of the root folder.

Enter a string value. Press Enter for the default ("").
root_folder_id> 空,直接回车。空是跟路径如果想用别的根路径
--------------------------------------------------------------
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Enter a string value. Press Enter for the default ("").
service_account_file> 直接回车
--------------------------------------------------------------
Edit advanced config? (y/n)
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 因为我们是vps操作,不能auto config
--------------------------------------------------------------
Please go to the following link: https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Log in and authorize rclone for access
Enter verification code>点击上面的连接获取key,贴入你获取到的key
--------------------------------------------------------------
Configure this as a team drive?
y) Yes
n) No (default)
y/n> y
--------------------------------------------------------------
Choose a number from below, or type in your own value
1 / 影音云端盘
\ "0AGfwXXXXXXXXXXXX"
2 / homenet6精英nas盘
\ "0AXXXXXXXXXXXXXXX"
Enter a Team Drive ID> 1 选择序号,挂载相应的盘符,以后想挂载多个盘可重复此步骤
--------------------------------------------------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y 
--------------------------------------------------------------
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   退出
  • 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
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78

3、挂载成本地磁盘:

mkdir -p /home/gdrive-影视   //建立挂载到本地的目录

/usr/bin/rclone mount video: /home/gdrive-影视 \  //上边设置的挂载谷歌盘名映射到本地的目录,这个目录会被emby服务器识别到。可以根据自己的情况相应修改。
 --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 &
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

4、设置自动开机挂载:

cat > /etc/systemd/system/rclone.service <<EOF
[Unit]
Description=Rclone
AssertPathIsDirectory=LocalFolder
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount video: /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 LocalFolder
Restart=on-abort
User=root

[Install]
WantedBy=default.target
EOF
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

5、查看挂载

df -h
  • 1

6、设置rclone启动

systemctl start rclone
  • 1

7、开启开机启动rclone

systemctl enable rclone
  • 1

8、安装bbrplus 这里和之前搭建SSR之类使用BBR加速一样 不赘述

选2,bbrplus加速
弹出的两个选择框都选no
安装完选择重启
再次输入这个命令
选择7,启动bbrplus加速

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
  • 1

9、虚拟内存

一般设置为内存的两倍

wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh
  • 1

10、打开emby网页端进行设置即可

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/166894
推荐阅读
相关标签
  

闽ICP备14008679号