Tube Archivist – 自托管 YouTube 媒体本地缓存服务器

Tube Archivist is Your self hosted YouTube media server, which also defines the primary scope of what this project tries to do:

  • Self hosted: This assumes you have full control over the underlying operating system and hardware and can configure things to work properly with Docker, it's volumes and networks as well as whatever disk storage and filesystem you choose to use.
  • YouTube: Downloading, indexing and playing videos from YouTube, there are currently no plans to expand this to any additional platforms.
  • Media server: This project tries to be a stand alone media server in it's own web interface.

Tube Archivist 会定时将指定频道的视频缓存(下载)到本地,实现 YouTube 视频的本地点播,这样就可以摆脱各种广告和推荐算法,同时节省带宽/流量

Web 界面使用 Django 开发,支持自定义缓存时间、视频质量、同时下载数量等设置,支持下载字幕(包括自动生成的字幕),Tube Archivist 只提供针对 YouTube 的视频缓存,没有打算支持其他视频平台

官方只提供了 Unraid 的安装教程,但实际上还是 docker 容器那一套

下文为 Debian 11 下 Tube Archivist 的安装和使用

环境

  • Debian 11
    • Docker、Docker-compose

参考

安装

获取 docker-compose 的 yaml 配置文件

wget https://raw.githubusercontent.com/tubearchivist/tubearchivist/master/docker-compose.yml

根据自身需求修改路径映射、端口映射、用户名密码

version: '3.3'

services:
  tubearchivist:
    container_name: tubearchivist
    restart: always
    image: bbilly1/tubearchivist:latest
    ports:
      - 8000:8000
    volumes:
      - media:/youtube
      - cache:/cache
    environment:
      - ES_URL=http://archivist-es:9200     # needs protocol e.g. http and port
      - REDIS_HOST=archivist-redis          # don't add protocol
      - HOST_UID=1000
      - HOST_GID=1000
      - TA_USERNAME=tubearchivist           # your initial TA credentials
      - TA_PASSWORD=verysecret              # your initial TA credentials
      - ELASTIC_PASSWORD=verysecret         # set password for Elasticsearch
      - TZ=America/New_York                 # set your time zone
    depends_on:
      - archivist-es
      - archivist-redis
  archivist-redis:
    image: redislabs/rejson:latest          # for arm64 use bbilly1/rejson
    container_name: archivist-redis
    restart: always
    expose:
      - "6379"
    volumes:
      - redis:/data
    depends_on:
      - archivist-es
  archivist-es:
    image: bbilly1/tubearchivist-es         # only for amd64, or use official es 7.17.2
    container_name: archivist-es
    restart: always
    environment:
      - "xpack.security.enabled=true"
      - "ELASTIC_PASSWORD=verysecret"       # matching Elasticsearch password
      - "discovery.type=single-node"
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - es:/usr/share/elasticsearch/data    # check for permission error when using bind mount, see readme
    expose:
      - "9200"

volumes:
  media:
  cache:
  redis:
  es:

运行 Tube Archivist

docker-compose up -d

使用

浏览器访问 IP:端口,使用设置的用户名密码登录

在 Channels 下添加欲订阅的 YouTube 频道,添加成功后会显示频道信息

然后进入 Downloads 页面,点击 Rescan subscribtions

Tube Archivist 会自动获取已订阅频道下的视频,并将视频加入下载队列

在设置中可以设置自动获取的视频数量,默认一次获取 50 个视频

视频获取完毕后点击 Start download 就可以开始下载队列,也可以手动点击队列中每一项的 download 按钮来下载单个视频,也可以通过点击 ignore 来忽略该视频

在设置中可以设置一次获取视频的数量、同时下载数量、下载视频的质量以及是否下载字幕,建议设置好后再下载,避免浪费带宽/流量

下载完毕后的视频会出现在 home(主页)下,点击即可开始观看

由于是从内网获取视频,播放速度非常快

发表回复

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据