diff options
author | metamuffin <metamuffin@disroot.org> | 2025-05-23 14:12:20 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-05-23 14:12:20 +0200 |
commit | 4b139e88a1879c8e4add31480bb254cd4e08181f (patch) | |
tree | 50b149daa8d4788380cd98635626e739febce8bf | |
parent | 339e37135212600284d2df67dce393c01f60cdf0 (diff) | |
download | isda-4b139e88a1879c8e4add31480bb254cd4e08181f.tar isda-4b139e88a1879c8e4add31480bb254cd4e08181f.tar.bz2 isda-4b139e88a1879c8e4add31480bb254cd4e08181f.tar.zst |
documentation for some workers
-rw-r--r-- | readme.md | 31 | ||||
-rw-r--r-- | scripts/complete_from_files.md | 11 | ||||
-rw-r--r-- | scripts/enqueue.md | 48 | ||||
-rw-r--r-- | scripts/ytdlp_channel_info.md | 0 | ||||
-rw-r--r-- | scripts/ytdlp_download.md | 0 | ||||
-rw-r--r-- | scripts/ytdlp_flatten.md | 0 |
6 files changed, 90 insertions, 0 deletions
@@ -2,6 +2,37 @@ Generic task queue server with scripts for downloading with different tools. +## Usage + +First start the queue daemon process. It will save its state to JSON files in +its working directory. As its first argument supply the global configuration +file. + +``` +cargo run -- config.yaml +``` + +The configuration file contains two keys read be the daemon `bind_port` and +`bind_addr`. All other options are passed as-is to the workers. + +Then you can start workers linked to the queue server. Most workers take the URI +to the worker websocket endpoint of the queue server as their first argument. + +``` +deno run -A scripts/<name>.ts ws://127.0.0.1:44794/worker_ws +``` + +Each workers usage and configuration is documented in the markdown file next to +the script. These are also linked below. + +## Worker Scripts + +- [enqueuer](./scripts/enqueue.md) +- [yt-dlp media downloader](./scripts/ytdlp_download.md) +- [yt-dlp playlist flattener](./scripts/ytdlp_flatten.md) +- [yt-dlp channel info generator](./scripts/ytdlp_channel_info.md) +- [complete tasks based on existing files](./scripts/complete_from_files.md) + ## License AGPL-3.0-only; See [COPYING](./COPYING). diff --git a/scripts/complete_from_files.md b/scripts/complete_from_files.md new file mode 100644 index 0000000..0884979 --- /dev/null +++ b/scripts/complete_from_files.md @@ -0,0 +1,11 @@ +# Complete From Files + +This is a oneshot worker that marks tasks as completed based on files existing. + +Provide the path to the directory of interest as the second argument. It will be +traversed recursively. + +Currently only two file/task patterns are recognized: + +- `___________.mkv`: `youtube:___________` +- `some title [___________].mkv`: `youtube:___________` diff --git a/scripts/enqueue.md b/scripts/enqueue.md new file mode 100644 index 0000000..24ad205 --- /dev/null +++ b/scripts/enqueue.md @@ -0,0 +1,48 @@ +# Enqueue + +Inserts tasks into the queue with some time interval. + +## Configuration + +- `enqueue` + - `list_file`: Path to the task list. The format is described below. (string) + - `kind`: Task kind to insert. + - `interval`: Number of seconds to wait in between inserts. (number) + - `filter`: Only inserts tasks that have this flag attached. The flag will be + removed. (optional string) + - `default_flags`: List of flags attached to every task except where manually + removed. (optional list of string) + - `data`: Additional attributes that will be attached to the tasks data. + +```yaml +enqueue: + - list_file: /home/user/silly_tasks.ini + kind: webpage-download + interval: 86400 + filter: "important" + default_flags: ["novideos"] + data: + priority: 100 + output: /home/user/somedir +``` + +## Task list file format + +A file that contains one task per line. Empty lines are ignored. The INI +syntax-highlighted works well with this format. + +Each line follows the format `OUTPUT=ID;FLAGS` where + +- `ID` forms the task key together with the task kind from the config +- `OUTPUT` is attached as-is to the task data as `output`. If output is already + specified in `data` then `OUTPUT` is path-joined to that. +- `FLAGS` is a space seperated list of flags that will be added to the task + data's `flags` attribute together with all default flags. Including + `-FLAGNAME` here, prevents the default flag `FLAGNAME` from being added. + +Sample file: + +```ini +example=https://example.org;important noimages +sometask=https://example.com;noimages -novideos +``` diff --git a/scripts/ytdlp_channel_info.md b/scripts/ytdlp_channel_info.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/scripts/ytdlp_channel_info.md diff --git a/scripts/ytdlp_download.md b/scripts/ytdlp_download.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/scripts/ytdlp_download.md diff --git a/scripts/ytdlp_flatten.md b/scripts/ytdlp_flatten.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/scripts/ytdlp_flatten.md |