- Postiz URL is now required (no built-in host); a key can never be sent to a default instance - /api/postiz/scheduled normalizes scheduled_date and widens the default window - Disabled channels are refused for posting; frontend excludes them from connected platforms - 4xx instead of 500 on missing clip URL / bad schedule date; Postiz error bodies truncated - Add tests/test_postiz.py (24 tests); fix remaining cloud-removal test drift - CLI defaults to localhost:8000; n8n workflows fixed against the real routes - Remove dead media-token auth code, stale copy (download_url/402) and doc drift
293 lines
No EOL
7.4 KiB
JSON
293 lines
No EOL
7.4 KiB
JSON
{
|
|
"name": "OpenShorts: video URL in, published-ready clips out (no polling)",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"content": "## OpenShorts + n8n, the whole loop\n\n**One HTTP request starts the job, one signed webhook ends it.** No polling loop, no wait nodes.\n\n### Setup (3 steps)\n1. Point the *Start OpenShorts job* node at your self-hosted instance (`http://localhost:8000`); no API key is needed on a self-hosted instance.\n2. Open the *Clips ready* webhook node, copy its **production** URL, and paste it as `webhook_url` in the *Start OpenShorts job* node body.\n3. Optional: set your own `webhook_secret`. OpenShorts signs the body with HMAC-SHA256 in the `X-OpenShorts-Signature` header (`sha256=<hex>`), so you can verify the sender.\n\n### What you get back\n`event`, `job_id`, `status`, and `clips[]` with `title` and `video_url` per clip. Failed jobs also fire the webhook with an `error` field, so the flow never hangs.\n\nAPI docs: http://localhost:8000/docs \u00b7 Self-hosted works the same on your own machine (MIT).",
|
|
"height": 460,
|
|
"width": 480
|
|
},
|
|
"id": "note-setup",
|
|
"name": "Sticky Note",
|
|
"type": "n8n-nodes-base.stickyNote",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
-560,
|
|
-80
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"formTitle": "Clip a video with OpenShorts",
|
|
"formDescription": "Paste a YouTube link (or any public video URL). You get 3-15 vertical clips with subtitles back.",
|
|
"formFields": {
|
|
"values": [
|
|
{
|
|
"fieldLabel": "Video URL",
|
|
"requiredField": true
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "form-trigger",
|
|
"name": "Video URL form",
|
|
"type": "n8n-nodes-base.formTrigger",
|
|
"typeVersion": 2,
|
|
"position": [
|
|
-80,
|
|
0
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"method": "POST",
|
|
"url": "http://localhost:8000/api/process",
|
|
"sendBody": true,
|
|
"specifyBody": "json",
|
|
"jsonBody": "={\n \"url\": \"{{ $json['Video URL'] }}\",\n \"acknowledged\": true,\n \"webhook_url\": \"PASTE_THE_PRODUCTION_URL_OF_THE_CLIPS-READY_WEBHOOK_NODE_HERE\",\n \"webhook_secret\": \"change-me\"\n}",
|
|
"options": {}
|
|
},
|
|
"id": "start-job",
|
|
"name": "Start OpenShorts job",
|
|
"type": "n8n-nodes-base.httpRequest",
|
|
"typeVersion": 4.2,
|
|
"position": [
|
|
180,
|
|
0
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"assignments": {
|
|
"assignments": [
|
|
{
|
|
"id": "a1",
|
|
"name": "job_id",
|
|
"value": "={{ $json.job_id }}",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "a2",
|
|
"name": "status",
|
|
"value": "={{ $json.status }}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "job-queued",
|
|
"name": "Job queued",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.4,
|
|
"position": [
|
|
440,
|
|
0
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"httpMethod": "POST",
|
|
"path": "openshorts-clips-ready",
|
|
"options": {}
|
|
},
|
|
"id": "clips-webhook",
|
|
"name": "Clips ready (webhook)",
|
|
"type": "n8n-nodes-base.webhook",
|
|
"typeVersion": 2,
|
|
"position": [
|
|
-80,
|
|
320
|
|
],
|
|
"webhookId": "2f8351c1-d51d-4af7-bab3-57f21e07956d"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"options": {
|
|
"caseSensitive": true,
|
|
"typeValidation": "strict",
|
|
"version": 2
|
|
},
|
|
"conditions": [
|
|
{
|
|
"id": "c1",
|
|
"leftValue": "={{ $json.body.event }}",
|
|
"rightValue": "job.completed",
|
|
"operator": {
|
|
"type": "string",
|
|
"operation": "equals"
|
|
}
|
|
}
|
|
],
|
|
"combinator": "and"
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "if-completed",
|
|
"name": "Job completed?",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 2.2,
|
|
"position": [
|
|
180,
|
|
320
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"fieldToSplitOut": "body.clips",
|
|
"options": {}
|
|
},
|
|
"id": "split-clips",
|
|
"name": "One item per clip",
|
|
"type": "n8n-nodes-base.splitOut",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
440,
|
|
220
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"assignments": {
|
|
"assignments": [
|
|
{
|
|
"id": "b1",
|
|
"name": "title",
|
|
"value": "={{ $json.title }}",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "b2",
|
|
"name": "video_url",
|
|
"value": "={{ $json.video_url }}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "clip-links",
|
|
"name": "Clip title + download link",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.4,
|
|
"position": [
|
|
700,
|
|
220
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"assignments": {
|
|
"assignments": [
|
|
{
|
|
"id": "e1",
|
|
"name": "job_id",
|
|
"value": "={{ $json.body.job_id }}",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "e2",
|
|
"name": "error",
|
|
"value": "={{ $json.body.error }}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "job-failed",
|
|
"name": "Job failed",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.4,
|
|
"position": [
|
|
440,
|
|
420
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"content": "## Do something with the clips\n\nConnect *Clip title + download link* to whatever comes next: a Slack or email notification, a Google Sheet log, or publish them via `POST /api/postiz/post`.\n\nEach item here is one finished 9:16 clip with subtitles burned in.",
|
|
"height": 220,
|
|
"width": 340
|
|
},
|
|
"id": "note-next",
|
|
"name": "Sticky Note 2",
|
|
"type": "n8n-nodes-base.stickyNote",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
960,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"connections": {
|
|
"Video URL form": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Start OpenShorts job",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Start OpenShorts job": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Job queued",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Clips ready (webhook)": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Job completed?",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Job completed?": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "One item per clip",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"node": "Job failed",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"One item per clip": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Clip title + download link",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"settings": {
|
|
"executionOrder": "v1"
|
|
},
|
|
"pinData": {}
|
|
} |