aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-05-23 14:12:20 +0200
committermetamuffin <metamuffin@disroot.org>2025-05-23 14:12:20 +0200
commit4b139e88a1879c8e4add31480bb254cd4e08181f (patch)
tree50b149daa8d4788380cd98635626e739febce8bf
parent339e37135212600284d2df67dce393c01f60cdf0 (diff)
downloadisda-4b139e88a1879c8e4add31480bb254cd4e08181f.tar
isda-4b139e88a1879c8e4add31480bb254cd4e08181f.tar.bz2
isda-4b139e88a1879c8e4add31480bb254cd4e08181f.tar.zst
documentation for some workers
-rw-r--r--readme.md31
-rw-r--r--scripts/complete_from_files.md11
-rw-r--r--scripts/enqueue.md48
-rw-r--r--scripts/ytdlp_channel_info.md0
-rw-r--r--scripts/ytdlp_download.md0
-rw-r--r--scripts/ytdlp_flatten.md0
6 files changed, 90 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index 1d52b96..28fedd0 100644
--- a/readme.md
+++ b/readme.md
@@ -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