91 lines
4.2 KiB
Markdown
91 lines
4.2 KiB
Markdown
---
|
||
layout : post
|
||
title : "Jellyfin&qBit: 自建家庭影音"
|
||
subtitle : "ADs? pay for songs? Go away!"
|
||
date : 2022-05-21 11:31:40
|
||
author : "Manford Fan"
|
||
catalog : false
|
||
header-img : "img/post-bg-universe.jpg"
|
||
tags :
|
||
- Jellyfin
|
||
- qBitTorrent
|
||
---
|
||
|
||
上周刚搭建好了mStream,上周日睡了一整天,晚上精神了,又失眠了一整夜。漫漫长夜,总要找点事情做,未竟的事业继续吧——Jellyfin。随着Jellyfin构建的完成,mStream昙花一现的历史也随之终结,虽然也不是很好用。Jellyfin集成了音乐,电影,电视剧,书籍,图片的汇总与播放功能,是作为家庭影院的一个比较好的方案选择。同时,该应用也是跨平台的,美中不足的是不支持离线访问,期待以后的更新。
|
||
|
||
## 一、Jellyfin
|
||
|
||
Jellyfin功能很强大,但是部署过程还是很简单的,官方给出了三种方式:docker,二进制包以及源码方式,如下是最简单的二进制安装方式:
|
||
|
||
```bash
|
||
$ apt install curl gnupg
|
||
$ curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/jellyfin.gpg
|
||
$ 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" | tee /etc/apt/sources.list.d/jellyfin.list
|
||
$ apt update
|
||
$ apt install jellyfin
|
||
```
|
||
|
||
## 二、qBitTorrent
|
||
|
||
qBitTorrent是跨平台的BT/PT下载工具,腾讯VPS的下行带宽被限制,但是上行带宽没有被限制,下载速度还是很可观的(可以达到30MBps,可以狠狠的薅一把羊毛了),所以可以直接用qBitTorrent的命令行版,也即nox/web UI版本来直接下载到VPS上,然后在通过Jellyfin观看。安装命令很简单,属于标准包,所以直接执行`apt install qbittorrent-nox`即可。运行的时候直接执行`qbittorrent-nox`,会出现如下:
|
||
|
||
```text
|
||
*** Legal Notice ***
|
||
qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.
|
||
|
||
No further notices will be issued.
|
||
|
||
Press 'y' key to accept and continue...
|
||
y
|
||
|
||
******** Information ********
|
||
To control qBittorrent, access the Web UI at http://localhost:8080
|
||
The Web UI administrator username is: admin
|
||
The Web UI administrator password is still the default one: adminadmin
|
||
This is a security risk, please consider changing your password from program preferences.
|
||
```
|
||
|
||
> **注意:**使用第一次必须先用手动执行一次`qbittorrent-nox`命令
|
||
|
||
## 三、配置域名以及反向代理
|
||
|
||
> **对于Jellyfin**
|
||
|
||
无需指定root,直接在一个location里面写一行`proxy_pass http://localhost:8096;`即可。如下是配置好的界面:
|
||
|
||
<center><img src="https://blog.rustle.cc/img/posts/jellyfin.png" width="800"></center>
|
||
|
||
> **对于qBitTorrent**
|
||
|
||
和Jellyfin一样,也是指定端口进行本机反向代理,但是配置好之后用域名访问发现返回了401状态码,但是使用IP+Port的方式正常访问。需要将如下三个复选框勾选掉,就能使用域名访问了,记得要修改密码~
|
||
|
||
<center><img src="https://blog.rustle.cc/img/posts/qBit401.png" width="800"></center>
|
||
|
||
> 如果下载进度一直是0,而且在线用户以及在线做种人数都是0,可尝试使用随机端口
|
||
|
||
## 四、开启VPS防火墙
|
||
|
||
Jellyfin默认端口是8096,qBitTorrent的默认端口是8080,这两个都需要同时在VPS和腾讯控制台添加白名单。
|
||
|
||
## 五、配置开机自启动
|
||
|
||
因为Jellyfin是通过二进制包安装的,所以不存在开机启动问题,直接使用`systemctl`工具来管理即可;但是qBitTorrent没有做systemd管理,启动方式也比较简单,直接是`qbittorrent-nox`,而且是前台运行,所以放在开机启动脚本中,并让其在后台工作即可。
|
||
|
||
## 六、问题记录
|
||
|
||
#### 1. iOS客户端只播放一首音乐就暂停
|
||
|
||
暂无,电脑端web界面无此问题
|
||
|
||
#### 2. 显示歌词问题
|
||
|
||
暂无
|
||
|
||
#### 3. 电视节目条目中的视频无法播放
|
||
|
||
暂无,修改成其他音乐视频即可播放
|
||
|
||
## 七、参考文档
|
||
|
||
- [Jellyfin官方网站](https://jellyfin.org/)
|