|
|
1 kuukausi sitten | |
|---|---|---|
| systemd | 1 kuukausi sitten | |
| web | 1 kuukausi sitten | |
| README.md | 1 kuukausi sitten | |
| proxmox-mount.md | 1 kuukausi sitten | |
| setup.sh | 1 kuukausi sitten |
Self-hosted YouTube archival system designed for Proxmox LXC (Alpine Linux). Archives YouTube videos as H.264/AAC MKVs with embedded metadata, written directly into a Jellyfin-compatible folder structure.
/media/yaar/YouTube/<Channel>/<Title>.mkv/media/yaar/Shows/<Series>/Season NN/SNNENN - <Title>.mkv/media/yaar/Movies/<Title> (Year)/<Title> (Year).mkv/opt/yaar/jobs/)YAAR installs entirely from inside your existing Alpine LXC container. The only thing done on the Proxmox host is attaching the Jellyfin bind-mount.
See proxmox-mount.md for the full guide. In short:
Web UI: Container → Resources → Add → Mount Point
/mnt/nas/jellyfin (your NAS location on the host)/nas/jellyfinOr via the Proxmox host shell:
pct set <CTID> -mp0 /mnt/nas/jellyfin,mp=/nas/jellyfin
pct restart <CTID>
# From the Proxmox host:
pct push <CTID> yaar.tar.gz /root/yaar.tar.gz
# Or via scp from any machine:
scp yaar.tar.gz root@<container-ip>:/root/
pct enter <CTID> # enter the container, or ssh into it
tar xzf /root/yaar.tar.gz -C /root/
sh /root/yaar/setup.sh
setup.sh detects if it's accidentally run on the Proxmox host and exits
immediately — it will not proceed unless it's running inside a container.
The script installs:
/etc/init.d/yaar)rc-service yaar start
rc-service yaar stop
rc-service yaar restart
rc-service yaar status
Logs:
tail -f /opt/yaar/logs/yaar.log # Application log
tail -f /opt/yaar/logs/gunicorn.log # Web server log
Point Jellyfin at the three library roots:
| Library type | Path |
|---|---|
| Movies | /media/yaar/Movies |
| Shows | /media/yaar/Shows |
| Other (YouTube) | /media/yaar/YouTube |
For the Shows library, enable NFO metadata reading so episode details from yt-dlp populate correctly. For YouTube videos, the library type "Other Videos" or "Shows" both work — choose based on preference.
| Setting | Value | Why |
|---|---|---|
| Video codec | H.264 (avc1) | Universal Jellyfin direct-play, no transcoding |
| Audio codec | AAC (mp4a) | Universal, no transcoding on any client |
| Container | MKV | Supports metadata, chapters, thumbnails |
| Quality | Best available H.264 | yt-dlp format selector: bestvideo[vcodec^=avc1]+bestaudio[acodec^=mp4a] |
If a video is only available as VP9/AV1 (e.g. high-res YouTube uploads), yt-dlp falls back to the best available VP9 + audio, then remuxes to MKV. The web UI shows whatever was actually used.
/opt/yaar/
web/
app.py ← Flask application
templates/
index.html ← Web UI
venv/ ← Python virtualenv
logs/
yaar.log
gunicorn.log
access.log
jobs/ ← Persisted job JSON files
/media/yaar/
Movies/
Fantastic Voyage (1966)/
Fantastic Voyage (1966).mkv
Fantastic Voyage (1966).nfo
Shows/
Kurzgesagt/
Season 01/
S01E01 - The Egg.mkv
S01E01 - The Egg.nfo
YouTube/
Veritasium/
Does Planet 9 Exist.mkv
Environment variables (set in /etc/yaar.env):
| Variable | Default | Description |
|---|---|---|
YAAR_BASE |
/opt/yaar |
App, logs, jobs directory |
YAAR_MEDIA |
/media/yaar |
Root media output directory |
YAAR_PORT |
7474 |
Web UI port |
/opt/yaar/venv/bin/pip install --upgrade yt-dlp
rc-service yaar restart
Download fails with "Sign in to confirm your age"
YouTube sometimes requires cookies for age-restricted content. Export cookies from a logged-in browser and pass them to yt-dlp via --cookies in build_ydl_opts() in app.py.
H.264 format not available / falls back to VP9 Some YouTube videos are only available in VP9. YAAR will still download and remux, but Jellyfin may transcode on lower-powered clients. This is a YouTube limitation, not a YAAR bug.
Container can't write to media directory
Ensure the bind mount path exists on the host and the container has write permission. For unprivileged containers, the UID/GID mapping may need adjustment: pct set <CT_ID> --mp0 /host/path,mp=/media/yaar,uid=0,gid=0.
Port already in use
Edit YAAR_PORT in /etc/yaar.env and restart the service.