Where Does MoneyPrinterTurbo Download Video Materials From? API Sources and Local Options Explained

MoneyPrinterTurbo downloads video materials from two public stock video APIs—Pexels and Pixabay—or loads them from a local directory if configured, with Pexels set as the default provider.

MoneyPrinterTurbo is an open-source automated video generation framework that sources stock footage to match generated scripts. Understanding where MoneyPrinterTurbo downloads video materials from requires examining the app/services/material.py module, which implements the search and retrieval logic for external media APIs. The system supports three distinct sources: the Pexels API as the primary default, Pixabay as an alternative, and local file storage for offline operation.

Stock Video Sources in MoneyPrinterTurbo

The application integrates with two major free stock video platforms and offers a local fallback mode. Each source is implemented as a dedicated search function that returns standardized metadata through the MaterialInfo dataclass defined in app/models/schema.py.

Pexels API (Default Provider)

The Pexels integration serves as the default video source. In app/services/material.py, the search_videos_pexels function (lines 34-50) constructs a request to the https://api.pexels.com/videos/search endpoint. The implementation passes the user’s query term, desired video orientation, and a fixed per-page limit of 20 results. Authentication occurs via an Authorization header containing an API key retrieved from app/config.py under the pexels_api_keys configuration value.

Pixabay API (Alternative Provider)

As an alternative, MoneyPrinterTurbo supports Pixabay through the search_videos_pixabay function (lines 91-108) in the same material service module. This function calls https://pixabay.com/api/videos/ with the search query, a video_type filter parameter, and the corresponding API key from the configuration. The request stack uses identical proxy and SSL handling as the Pexels implementation, ensuring consistent network behavior across providers.

Local Directory (Offline Mode)

Users can bypass external APIs entirely by selecting the local source option. When configured, the system skips network requests and loads existing video files from a specified local directory. This logic is exposed through the source-selection controls in webui/Main.py (lines 581-587), allowing the download_videos orchestrator to route directly to disk-based assets rather than HTTP endpoints.

The Download Orchestration Pipeline

The central routine coordinating these sources is download_videos in app/services/material.py. This function accepts a source parameter—accepting the string values "pexels", "pixabay", or "local"—and delegates to the appropriate search implementation based on the selection.

After retrieving video URLs from the chosen API, the system calls save_video from app/services/video.py to perform the actual download. This helper function executes requests.get with a browser-like User-Agent header to mimic standard client traffic and streams the content to disk. The implementation includes intelligent caching: if a video file already exists in the local cache directory, MoneyPrinterTurbo reuses the existing file rather than issuing redundant network requests.

Configuring API Keys and Source Selection

API credentials and source preferences are managed through two primary locations. The app/config.py file stores the lists of available keys in pexels_api_keys and pixabay_api_keys arrays, allowing for key rotation or multiple account support. The webui/Main.py module renders the user interface controls where operators select the active video source and input their API credentials, binding these values to the configuration layer that the material service consumes.

Practical Code Examples

The following examples demonstrate how to trigger downloads from each supported source using the Python API directly.

Fetching from Pexels (Default)

This example retrieves portrait-oriented clips from Pexels to cover 30 seconds of narration, capping each segment at 5 seconds:

from app.services.material import download_videos

clip_paths = download_videos(
    task_id="demo123",
    search_terms=["stock market", "money printing"],
    source="pexels",           # Optional; "pexels" is the default

    video_aspect="portrait",   # Typical for TikTok/Reels formats

    audio_duration=30,         # Total audio length to match

    max_clip_duration=5        # Maximum seconds per clip

)

print("Downloaded clips:", clip_paths)

Switching to Pixabay

To use the Pixabay catalog instead, change the source parameter while maintaining the same search interface:

clip_paths = download_videos(
    task_id="demo456",
    search_terms=["currency exchange"],
    source="pixabay",          # Explicitly selects Pixabay API

    video_aspect="portrait",
    audio_duration=20,
    max_clip_duration=4
)

Loading Local Video Files

For offline operation or custom footage, set the source to local and provide an empty search terms list:

clip_paths = download_videos(
    task_id="demo_local",
    search_terms=[],           # No remote search required

    source="local",            # Forces local-only mode

    video_aspect="portrait",
    audio_duration=15,
    max_clip_duration=5
)

Summary

  • MoneyPrinterTurbo downloads video materials from Pexels by default, calling the https://api.pexels.com/videos/search endpoint through the search_videos_pexels function in app/services/material.py.
  • Pixabay serves as an alternative API source, accessible via the search_videos_pixabay function using the https://pixabay.com/api/videos/ endpoint.
  • Local directories provide an offline option, bypassing network calls entirely when source="local" is specified in the webui/Main.py interface or API call.
  • The download_videos function orchestrates the pipeline, delegating to save_video in app/services/video.py for HTTP streaming and disk writing, with built-in file caching to avoid redundant downloads.

Frequently Asked Questions

What is the default video source in MoneyPrinterTurbo?

Pexels is the default provider. When the source parameter is omitted from download_videos or not explicitly set in the UI controls at webui/Main.py, the system automatically routes requests to the Pexels video search API using the configured API keys from app/config.py.

How does MoneyPrinterTurbo handle API authentication for video downloads?

The system retrieves API keys from the pexels_api_keys and pixabay_api_keys lists defined in app/config.py. For Pexels requests, the search_videos_pexels function injects the key into an Authorization HTTP header. Pixabay requests append the key as a query parameter to the https://pixabay.com/api/videos/ endpoint, consistent with that provider’s specification.

Can I use my own video files instead of downloading from Pexels or Pixabay?

Yes. Set the video source to local either through the web UI in webui/Main.py or by passing source="local" to the download_videos function. In this mode, MoneyPrinterTurbo skips all network requests and loads video files directly from your configured local directory, making it ideal for proprietary or custom footage.

Does MoneyPrinterTurbo re-download videos if they already exist locally?

No. The save_video function in app/services/video.py checks for existing files on disk before initiating any HTTP GET request. If a video file with the matching identifier already exists in the cache directory, the system reuses the local copy, improving performance and reducing redundant API consumption.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →