Magic Podcast turns PDFs, documents, and notes into a natural two-host conversation you can listen to in minutes.
Use MagicPodcast to:
Ok, want me to make a podcast of this "topic/pdf" in "language". Should I do it?https://www.magicpodcast.app/app so user can open their podcast dashboard.ai podcast, podcast, podcast generator, ai podcast generator, pdf to podcast, text to podcast, podcast from pdf, audio podcast, magicpodcast
Set required env:
export MAGICPODCAST_API_URL="https://api.magicpodcast.app"
export MAGICPODCAST_API_KEY="<your_api_key>"
Get API key:
https://www.magicpodcast.app/openclaw
It's free to get started, and it takes under a minute. Open https://www.magicpodcast.app/openclaw, sign in with Google, copy your API key, and paste it here.
1) topic
2) source (PDF URL or pasted text)
3) language
4) final confirmation before create
Never interpolate raw user text directly into shell commands.
Always validate first, then JSON-encode with jq.
safe_job_id() {
printf '%s' "$1" | grep -Eq '^[A-Za-z0-9_-]{8,128}$'
}
safe_http_url() {
printf '%s' "$1" | grep -Eq '^https?://[^[:space:]]+$'
}
Create from PDF:
# Inputs expected from conversation state:
# PDF_URL, LANGUAGE
if ! safe_http_url "$PDF_URL"; then
echo "Invalid PDF URL" >&2
exit 1
fi
payload="$(jq -n --arg pdfUrl "$PDF_URL" --arg language "$LANGUAGE" '{pdfUrl:$pdfUrl,language:$language}')"
curl -sS -X POST "$MAGICPODCAST_API_URL/agent/v1/podcasts/pdf" \
-H "Content-Type: application/json" \
-H "x-api-key: $MAGICPODCAST_API_KEY" \
--data-binary "$payload"
Create from text:
# Inputs expected from conversation state:
# SOURCE_TEXT, LANGUAGE
payload="$(jq -n --arg text "$SOURCE_TEXT" --arg language "$LANGUAGE" '{text:$text,language:$language}')"
curl -sS -X POST "$MAGICPODCAST_API_URL/agent/v1/podcasts/text" \
-H "Content-Type: application/json" \
-H "x-api-key: $MAGICPODCAST_API_KEY" \
--data-binary "$payload"
Check job once:
# Input expected from API response:
# JOB_ID
if ! safe_job_id "$JOB_ID"; then
echo "Invalid job id" >&2
exit 1
fi
curl -sS "$MAGICPODCAST_API_URL/agent/v1/jobs/$JOB_ID" \
-H "x-api-key: $MAGICPODCAST_API_KEY"
https://www.magicpodcast.app/app.outputs.shareUrl as the default completion link.outputs.shareUrl is missing, fall back to outputs.appUrl.Here is your podcast link: .Status checks:
statusLabel = "complete": return outputs.shareUrl (or outputs.appUrl as fallback).statusLabel = "failed": return error message/details to user.共 1 个版本