Go to file
LordMZTE 7da07c4ca4
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
chore: port to zig 0.12.0 and event loop restructuring
2024-04-24 17:50:15 +02:00
assets feat: add clear button to enqueue form 2023-07-25 21:51:59 +02:00
cli chore: port to zig 0.12.0 and event loop restructuring 2024-04-24 17:50:15 +02:00
frontend chore: group API endpoints 2023-08-06 22:15:12 +02:00
nixos feat: NixOS support and Zig update 2024-02-23 18:42:31 +01:00
server chore: port to zig 0.12.0 and event loop restructuring 2024-04-24 17:50:15 +02:00
.gitignore init 2023-01-30 23:40:13 +01:00
.woodpecker.yml feat: add CLI 2023-08-07 15:13:51 +02:00
assets.zig feat: add logo and minify CSS 2023-04-21 22:52:38 +02:00
build.hxml feat: rewrite frontend in haxe 2023-02-04 21:33:23 +01:00
build.zig feat: NixOS support and Zig update 2024-02-23 18:42:31 +01:00
build.zig.zon feat: NixOS support and Zig update 2024-02-23 18:42:31 +01:00
conf.json chore: port to zig 0.12.0 and event loop restructuring 2024-04-24 17:50:15 +02:00
deps.nix feat: NixOS support and Zig update 2024-02-23 18:42:31 +01:00
flake.lock feat: NixOS support and Zig update 2024-02-23 18:42:31 +01:00
flake.nix add nix develop shell 2024-02-26 18:10:33 +01:00
hxformat.json feat: rewrite frontend in haxe 2023-02-04 21:33:23 +01:00
LICENSE feat: relicense to AGPL 2023-08-19 11:10:30 +02:00
README.md chore: port to zig 0.12.0 and event loop restructuring 2024-04-24 17:50:15 +02:00
vidzig.service feat: add systemd unit 2023-01-31 00:08:50 +01:00

logo

Vidzig — Video download server

Vidzig is a HTTP server that allows you to enqueue links to videos. If Vidzig is unpaused, it will begin spawning yt-dlp to download these videos. These videos are accessible via a web interface or a (as yet undocumented) JSON API.

Why?

I have terrible internet and can't watch videos in 1080p, so I collect them up over a day and have a Rasperry Pi running vidzig download them overnight.

Building

  1. Install the Zig 0.12.0 compiler and a Haxe compiler for the frontend.
  2. zig build
  3. If that doesn't work, bug me about it

Deployment

NEVER DEPLOY VIDZIG OUTSIDE YOUR LAN!

Not only would that make absolutely no sense, but also, vidzig has not been tested against path traversal attacks, and while there are some (buggy) checks in place, these will almost certainly not hold up to real attacks!

NixOS

The repository contains a NixOS module. You may pull it in as a flake and use it with Nix like any other service.

  1. Install yt-dlp on the server. Yes, I know. Dependency on some python trash, but I sadly don't know any good alternatives :(.

  2. Create a JSON configuration file in a directory of your choice (I recommend /etc/vidzig/conf.json) This is an example JSON file. Note that comments and trailing commas are not supported in the actual config! All values are required unless noted otherwise.

{
    // Address and port to bind to. Use 0.0.0.0 to allow access from other devices.
    "bind": {
        "ip": "127.0.0.1",
        "port": 8080,
    },

    // Directory to use for saving data such as videos.
    "data_dir": "/mnt/storage/vidzig",

    // Base URL vidzig is accessible from. This is useful if vidzig is running behind a reverse proxy.
    "base_url": "http://my.host/vidzig",

    // (optional) Command for youtube-dl.
    //
    // Accepts these format string templates:
    // - %u: URL
    // - %o: Output file template
    //
    // Vidzig might append options to this depending on the options checked on the frontend.
    "ytdl_argv": [
        "yt-dlp",
        "%u",
        "--quiet",
        "--embed-metadata",
        "--embed-subs",
        "--output",
        "%o",
    ],

    // Format to pass to ytdl when downloading videos.
    "video_format": "bestvideo[height<=1080]+bestaudio/best[height<=1080]",

    // Format to pass to ytdl when downloading audio only.
    "audio_format": "ba[acodec=opus]/ba",

    // Automatically pause after queue has been completed
    // Default: true
    "autopause": true,
}
  1. Run the binary and pass the config file path as an argument: /path/to/vidzig /path/to/conf.json

There is also a vidzig.service file for managing Vidzig using SystemD.