使用Podcastfy开源Python工具包,将文字、图片、PDF文档、网站或YouTube视频转换为多语言AI生成播客音频。
Transform content into engaging AI-generated podcasts using Podcastfy.
Podcastfy is an open-source Python package that transforms multi-modal content (text, images, websites, PDFs, YouTube videos) into engaging, multi-lingual audio conversations using GenAI.
It's like NotebookLM's podcast feature but open-source and programmatic.
bash
pip install podcastfy
bash
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
Create a .env file with your API keys:
bash
# Required: At least one LLM + one TTS
GEMINI_API_KEY=your_gemini_api_key # Default: transcript generation
OPENAI_API_KEY=your_openai_api_key # Default: TTS
# Optional (for other TTS models)
ELEVENLABS_API_KEY=your_elevenlabs_api_key
Supported TTS Models:
ModelQualityAPI Key RequiredOpenAI (default)GoodYesElevenLabsGreat (customizable)YesGoogle (gemini/geminimulti)Best (English only)YesEdgeBasicNo
Recommended Setup:
bash
python -m podcastfy.client --url https://example.com/article1 --url https://example.com/article2
bash
python -m podcastfy.client --url https://youtube.com/watch?v=xxx
bash
python -m podcastfy.client --file path/to/document.pdf
bash
python -m podcastfy.client --image path/to/image1.jpg --image path/to/image2.png
bash
python -m podcastfy.client --text "Your raw text content here"
bash
python -m podcastfy.client --url https://example.com/article --longform
bash
python -m podcastfy.client --url https://example.com/article --transcript-only
python
from podcastfy.client import generate_podcast
# From URLs
audio_file = generate_podcast(
urls=["https://example.com/article1", "https://example.com/article2"]
)
# From local files
audio_file = generate_podcast(
file="path/to/urls.txt"
)
# From images
audio_file = generate_podcast(
image=["path/to/image1.jpg", "path/to/image2.png"]
)
# Longform
audio_file = generate_podcast(
urls=["https://example.com/article"],
longform=True
)
bash
# Custom conversation config
python -m podcastfy.client --url https://example.com/article --conversation-config config.yaml
# Use specific TTS model
python -m podcastfy.client --url https://example.com/article --tts-model elevenlabs
# Use local LLM for privacy
python -m podcastfy.client --url https://example.com/article --transcript-only --local
# Output to specific directory
python -m podcastfy.client --url https://example.com/article --output-dir ./my-podcasts
Use OpenClaw's exec tool:
bash
python -m podcastfy.client --url https://example.com/article
Generate a Python script and run it:
python
# Script will be created by the skill
from podcastfy.client import generate_podcast
audio = generate_podcast(
urls=["<user_provided_url>"],
output_dir="./podcasts"
)
bash
# Convert dental research articles to audio
python -m podcastfy.client --url https://www.dental.com/research/article
bash
# Turn course PDFs into listenable content
python -m podcastfy.client --file ./dental-course/lecture1.pdf
bash
# Transform patient info sheets to audio
python -m podcastfy.client --text "Dental implant procedure explained..."
bash
# Turn dental education videos into podcasts
python -m podcastfy.client --url https://youtube.com/watch?v=dental-education-video
--transcript-only or alongside audio)./podcastfy_output/bash
# Install ffmpeg
brew install ffmpeg # macOS
sudo apt install ffmpeg # Linux
Make sure your .env file is in the correct directory and API keys are set.
Google's multi-speaker TTS requires allowlisting. Use OpenAI or ElevenLabs instead.
Note: Requires Python 3.11+ and FFmpeg.