This commit is contained in:
parent
cd75bffa52
commit
2c1a0c8037
|
|
@ -22,4 +22,4 @@ Commits follow a Conventional Commits prefix (`fix:`, `refactor:`) in imperative
|
|||
Document expected locations for `yt-dlp`, cookies, and OPML files when altering defaults. If a change requires bgutil or other external services, provide startup commands and update the sample `config.json`. Ensure new options degrade gracefully for existing configs and call out migration steps in the PR description.
|
||||
|
||||
## HTTP API
|
||||
Enable the intake server with `http_api.enable` (binds to `127.0.0.1:4416`). Set `auth_token` or point `auth_token_file` at a mounted secret, and use `queue_file` to persist pending jobs. Example: `curl -H "Authorization: Bearer $TOKEN" -d '{"url":"https://youtu.be/ID","out_dir":"Channel"}' http://127.0.0.1:4416/v1/videos`. Inspect the queue with `curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:4416/status`.
|
||||
Enable the intake server with `http_api.enable` (default bind `0.0.0.0:6901`). Set `auth_token` or point `auth_token_file` at a mounted secret, and use `queue_file` to persist pending jobs. Example: `curl -H "Authorization: Bearer $TOKEN" -d '{"url":"https://youtu.be/ID","out_dir":"Channel"}' http://127.0.0.1:6901/v1/videos`. Inspect the queue with `curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:6901/status`.
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ COPY <<-EOT /data/config.json
|
|||
"out_dir": "/data/vids",
|
||||
"http_api": {
|
||||
"enable": true,
|
||||
"listen": "127.0.0.1:4416",
|
||||
"listen": "127.0.0.1:6901",
|
||||
"auth_token_file": "/run/secrets/subsyt-token",
|
||||
"queue_file": "/data/api-queue.json"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ OPML export.
|
|||
{
|
||||
"http_api": {
|
||||
"enable": true,
|
||||
"listen": "127.0.0.1:4416",
|
||||
"listen": "0.0.0.0:6901",
|
||||
"auth_token_file": "/run/secrets/subsyt-token",
|
||||
"queue_file": "./tmp/api-queue.json"
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ curl \
|
|||
-H "Authorization: Bearer $(cat /run/secrets/subsyt-token)" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data '{"url":"https://youtu.be/VIDEO","out_dir":"Channel"}' \
|
||||
http://127.0.0.1:4416/v1/videos
|
||||
http://127.0.0.1:6901/v1/videos
|
||||
```
|
||||
|
||||
Requests reuse the configured yt-dlp binary, honor existing throttling, and
|
||||
|
|
@ -295,7 +295,7 @@ persist through restarts when `queue_file` is provided.
|
|||
Check the pending queue for debugging:
|
||||
|
||||
```
|
||||
curl -H "Authorization: Bearer super-secret" http://127.0.0.1:4416/status
|
||||
curl -H "Authorization: Bearer super-secret" http://127.0.0.1:6901/status
|
||||
```
|
||||
|
||||
## result
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import (
|
|||
"git.meatbag.se/varl/subsyt/internal/config"
|
||||
)
|
||||
|
||||
const defaultListen = "127.0.0.1:4416"
|
||||
const defaultListen = "0.0.0.0:6901"
|
||||
|
||||
type Server struct {
|
||||
cfg config.Http_api
|
||||
|
|
|
|||
Loading…
Reference in a new issue