assets | ||
frontend | ||
src | ||
.gitignore | ||
assets.zig | ||
build.hxml | ||
build.zig | ||
conf.json | ||
hxformat.json | ||
LICENSE | ||
README.md | ||
vidzig.service |
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
- Install the latest Zig master version and a Haxe compiler for the frontend.
zig build
- 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!
-
Install
yt-dlp
on the server. Yes, I know. Dependency on some python trash, but I sadly don't know any good alternatives :(. -
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",
"--format",
"bestvideo[height<=1080]+bestaudio/best[height<=1080]",
"--output",
"%o",
],
// Automatically pause after queue has been completed
// Default: true
"autopause": true,
}
- 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.