Invidious

Invidious 保护您免受 Google 的窥探。它也不会跟踪你。

Invidious 可让您观看视频而不会被烦人的广告打扰。

Invidious 允许您订阅频道和创建播放列表,而无需 YouTube 帐户。

Invidious 有多种不同的语言版本。

Invidious 可让您观看视频而不会被烦人的广告打扰。

Invidious 为开发人员提供功能齐全且文档齐全的 REST API。


Docker-Compose

创建 docker-compose.yml 文件

1
nano docker-compose.yml

官方 docker-compose.yml 示例

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
version: "3"
services:

invidious:
image: quay.io/invidious/invidious:latest
# image: quay.io/invidious/invidious:latest-arm64 # ARM64/AArch64 devices
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
environment:
# Please read the following file for a comprehensive list of all available
# configuration options and their associated syntax:
# https://github.com/iv-org/invidious/blob/master/config/config.example.yml
INVIDIOUS_CONFIG: |
db:
dbname: invidious
user: kemal
password: kemal
host: invidious-db
port: 5432
check_tables: true
# external_port:
# domain:
# https_only: false
# statistics_enabled: false
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
interval: 30s
timeout: 5s
retries: 2
logging:
options:
max-size: "1G"
max-file: "4"
depends_on:
- invidious-db

invidious-db:
image: docker.io/library/postgres:14
restart: unless-stopped
volumes:
- postgresdata:/var/lib/postgresql/data
- ./config/sql:/config/sql
- ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
environment:
POSTGRES_DB: invidious
POSTGRES_USER: kemal
POSTGRES_PASSWORD: kemal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
postgresdata:
  1. 个人 docker-compose.yml 修改版

  2. 127.0.0.1:3000:3000 修改成自己的端口 5000:3000

  3. 修改 postgresdata:/var/lib/postgresql/datapostgresql 数据存储在当前文件夹下,而不是以卷数据形式存在,./postgresdata:/var/lib/postgresql/data

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
version: "3"
services:

invidious:
image: quay.io/invidious/invidious:latest
restart: unless-stopped
container_name: invidious
ports:
- "5000:3000"
environment:
INVIDIOUS_CONFIG: |
db:
dbname: invidious
user: kemal
password: kemal
host: invidious-db
port: 5432
check_tables: true
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
interval: 30s
timeout: 5s
retries: 2
logging:
options:
max-size: "1G"
max-file: "4"
depends_on:
- invidious-db

invidious-db:
image: docker.io/library/postgres:14
container_name: invidious_postgres
restart: unless-stopped
volumes:
- ./postgresdata:/var/lib/postgresql/data
- ./config/sql:/config/sql
- ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
environment:
POSTGRES_DB: invidious
POSTGRES_USER: kemal
POSTGRES_PASSWORD: kemal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
1
docker-compose up -d

打开 5000 端口

1
ufw allow 5000/tcp

一键脚本

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
79
80
81
82
83
84
85
86
87
88
89
90
#! /bin/bash

red(){
echo -e "\033[31m\033[01m$1\033[0m"
}
green(){
echo -e "\033[32m\033[01m$1\033[0m"
}
yellow(){
echo -e "\033[33m\033[01m$1\033[0m"
}


# Invidious

function invidious_install(){
if nc -z localhost 5000; then
echo " 5000 端口已经被占用,请检查相关进程。"
exit 1
fi
if docker ps -a --format "{{.Names}}" | grep -q "invidious" && docker ps -a --format "{{.Names}}" | grep -q "invidious_postgres"; then
echo "invidious 和 invidious_postgres 容器名已经被占用"
exit 1
fi
if [ ! -d /root/docker/Invidious ]; then
mkdir -p /root/docker/Invidious
fi
cd /root/docker/Invidious
if [ -f "docker-compose.yml" ]; then
rm docker-compose.yml
fi
cat <<EOF > docker-compose.yml
version: "3"
services:

invidious:
image: quay.io/invidious/invidious:latest
restart: unless-stopped
container_name: invidious
ports:
- "5000:3000"
environment:
INVIDIOUS_CONFIG: |
db:
dbname: invidious
user: kemal
password: kemal
host: invidious-db
port: 5432
check_tables: true
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
interval: 30s
timeout: 5s
retries: 2
logging:
options:
max-size: "1G"
max-file: "4"
depends_on:
- invidious-db

invidious-db:
image: docker.io/library/postgres:14
container_name: invidious_postgres
restart: unless-stopped
volumes:
- ./postgresdata:/var/lib/postgresql/data
- ./config/sql:/config/sql
- ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
environment:
POSTGRES_DB: invidious
POSTGRES_USER: kemal
POSTGRES_PASSWORD: kemal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
EOF
docker-compose up -d
ufw allow 5000/tcp
yellow "-----------------------------------------------"
green " Web 端口:5000"
echo
green " Docker IP = $(ip addr show docker0 | grep 'inet\b' | awk '{print $2}' | cut -d '/' -f1):5000"
echo
green " Web 网址 = http://$(ifconfig $(ifconfig | grep -oP 'enp\w+') | grep 'inet ' | awk '{print $2}'):5000"
echo
green " Invidious 安装完毕!"
yellow "-----------------------------------------------"
}
invidious_install

总结

一个简洁干净的 Invidious 就此搭建完成。

可以在不开代理的情况下,愉快的观看 Youtube

公开的 Invidious 实例网站

image-20230606185108244

image-20230606191223871

image-20230606190454866


官方网站:https://invidious.io/

官方文档:https://docs.invidious.io/installation/