Bucket Modules¶
Why a bucket upload step is required¶
The generated video exists on local disk. Instagram publishing is done through the Graph API, which expects a publicly reachable media URL during media object creation. The bucket layer uploads the local file and returns that URL.
Provider order (current behavior)¶
Primary: Imgur
Fallback: tmpfiles.org
If Imgur upload fails, the pipeline automatically falls back to tmpfiles.org.
Bucket Orchestrator¶
Bucket upload orchestrator.
Why this layer exists: - The Instagram Graph API publish step requires a public, retrievable media URL. - The generated video is local, so it must be uploaded to a temporary/public host first.
Provider order: 1. Imgur (primary) 2. tmpfiles.org (fallback)
- app.bucket.main.upload_to_bucket(video_path, title, description)¶
Upload video to a public host and return a direct URL usable by Instagram.
Imgur Provider¶
Imgur bucket provider (primary).
Uploads a local video file to Imgur and returns the public media URL. This is the first provider attempted by app.bucket.main.upload_to_bucket.
- app.bucket.imgur.upload_video_imgur(video_path, title, description)¶
Upload a video to Imgur and return the resulting public link.
tmpfiles Provider¶
tmpfiles.org bucket provider (fallback).
Used when the primary Imgur upload path fails. Returns a direct download URL that can be consumed by the Instagram publish flow.
- app.bucket.tmpfiles.upload_video_tmpfiles(video_path)¶
Upload a local file to tmpfiles.org and return a direct download URL.
Additional/utility bucket modules¶
Utility for refreshing Imgur OAuth tokens.
This module is intentionally side-effect free on import so it can be documented by Sphinx autodoc without performing network calls.
- app.bucket.generate_imgur_access_token.generate_imgur_access_token() str¶
Request a refreshed Imgur token payload and return response text.
The purpose of this module is to take in a video_path, upload it to Giphy, and return its URL. Giphy only allows uploading videos with audio in its Clips API. But, that API is approval-only. This module is useless now.
- app.bucket.giphy.upload_video_giphy(video_path=None, tags=None, source_post_url=None, username=None, country_code=None, region=None, source_image_url=None)¶