Compare commits

...

1 Commits

Author SHA1 Message Date
Gilad Resisi
24fa15026e feat(media): optional RUNPOD_API_URL for a local postiz-uploader
RunPodMediaProcessor builds its base URL from RUNPOD_API_URL when set,
otherwise https://api.runpod.ai/v2 as before, so production is
unchanged. The media, ingest and clip processors all go through this
class, so all three can point at a local postiz-uploader
(python -m postiz_uploader.devapi) for integration runs without code
edits. .env.example documents it, including moving the uploader off
port 8000 when a local Temporal already holds it.

Verified locally against a local postiz-uploader: a 504 MB video
uploaded through the composer reached ready with
RUNPOD_API_URL=http://localhost:18000/v2, and an unset value keeps the
api.runpod.ai URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 14:58:46 +07:00
2 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,10 @@ CLOUDFLARE_REGION="auto"
## the media record reports status "processing" until the normalized file replaces the original.
#RUNPOD_API_KEY=""
#RUNPOD_ENDPOINT_ID=""
## Local development only: point the RunPod endpoints at a local postiz-uploader (python -m postiz_uploader.devapi,
## or its docker compose, port 8000 unless UPLOADER_PORT moves it). Leave unset in production. If a local Temporal
## already holds port 8000, start the uploader with UPLOADER_PORT=18000 and use "http://localhost:18000/v2" here.
#RUNPOD_API_URL="http://localhost:8000/v2"
## Optional video clipping (YouTube video -> captioned vertical clips -> draft posts). Requires STORAGE_PROVIDER="cloudflare",
## RUNPOD_API_KEY (with access to both endpoints below) and OPENAI_API_KEY. Ingest jobs go to the CPU endpoint, clip jobs to the
## GPU endpoint of postiz-uploader (which needs its own Oxylabs account to fetch from YouTube); Deepgram transcribes videos

View File

@ -18,7 +18,9 @@ export class RunPodMediaProcessor<
private _baseUrl: string;
constructor(private _apiKey: string, endpointId: string) {
this._baseUrl = `https://api.runpod.ai/v2/${endpointId}`;
this._baseUrl = `${
process.env.RUNPOD_API_URL || 'https://api.runpod.ai/v2'
}/${endpointId}`;
}
private async request(path: string, init?: RequestInit) {