ytd/README.md
2026-04-07 13:16:21 +03:00

72 lines
1.6 KiB
Markdown

# ytd
YouTube daemon and CLI tool for crawling and processing channels with pre-configured commands vector.
_This tool was initially created as a helper for the [Pidpilne](https://codeberg.org/YGGverse/pidpilne) project, impressed by [ytsub](https://github.com/sarowish/ytsub) and [rustypipe](https://codeberg.org/ThetaDev/rustypipe) API._
## Install
``` bash
cargo install ytd
```
## Usage
Foreground / testing:
``` bash
RUST_LOG=trace cargo run -- -c example/config.toml
```
Background / daemon:
``` bash
RUST_LOG=ytd=warn NO_COLOR=1 /usr/local/bin/ytd -c /etc/config.toml
```
* make sure `update` option is defined (in the config file)
### systemd
``` bash
git clone https://codeberg.org/yggverse/ytd.git
cd ytd
cargo build --release --locked
sudo install target/release/ytd /usr/local/bin
sudo cp example/config.toml /etc/ytd.toml
sudo useradd -s /usr/sbin/nologin -Mr ytd
sudo mkdir /var/lib/ytd && sudo chown ytd:ytd /var/lib/ytd
sudo mkdir /var/log/ytd && sudo chown ytd:ytd /var/log/ytd
```
``` /etc/systemd/system/ytd.service
#/etc/systemd/system/ytd.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
User=ytd
Group=ytd
Environment="RUST_LOG=ytd=warn"
Environment="NO_COLOR=1"
# Environment="HTTP_PROXY=socks5://127.0.0.1:1080"
# Environment="HTTPS_PROXY=socks5://127.0.0.1:1080"
WorkingDirectory=/var/lib/ytd
ExecStart=/usr/local/bin/ytd -c=/etc/ytd.toml
Restart=always
StandardOutput=file:///var/log/ytd/debug.log
StandardError=file:///var/log/ytd/error.log
[Install]
WantedBy=multi-user.target
```
* `sudo systemctl restart ytd`
* `sudo systemctl enable ytd`
* `sudo systemctl status ytd`