-
-
Notifications
You must be signed in to change notification settings - Fork 38
Facebook Reels Uploader
OpenSource Clipping includes a standalone Facebook Pages Reels auto-uploader and scheduler, enabling you to publish generated clips directly to your Facebook Page via the Meta Graph API.
To use the Facebook Uploader, you need:
- A Facebook Page where you have admin/editor access.
- A Page Access Token with
pages_manage_posts,pages_read_engagement, andpages_show_listpermissions. - The Page ID of your Facebook Page.
- Generated clips in the
outputs/directory with arender_manifest.json.
Set up your environment variables in the .env file at the root of the repository:
META_PAGE_ID="your_facebook_page_id"
META_PAGE_ACCESS_TOKEN="your_page_access_token_here"
META_GRAPH_VERSION="v25.0" # Optional, defaults to v25.0After rendering your clips, run the Facebook uploader CLI tool:
python run_fb_upload.pyThis will:
- Validate your Page Access Token.
- Read the
outputs/render_manifest.jsonfor pending clips. - Automatically schedule the clips at 5-hour intervals (by default).
- Synchronize the
fb_upload_statusinoutputs/render_manifest_fb_uploaded.json.
You can adjust the interval between scheduled posts or test the uploader with a single video:
# 3-hour intervals with Jakarta timezone
python run_fb_upload.py --interval-hours 3 --tz-name "Asia/Jakarta"
# Test mode: only upload the FIRST item in the manifest
python run_fb_upload.py --test-modepython run_fb_upload.py --helpThe uploader automatically enforces Meta's safety guidelines and API limits to prevent account restrictions:
- 24-Hour Rolling Quota: Meta limits Reels to a maximum of 30 videos per 24-hour window. The script safely counts your recent uploads and stops if you reach this limit.
- Minimum Schedule Time: Reels must be scheduled at least 10 minutes into the future. The uploader automatically bumps schedules that are too close.
- Maximum Schedule Time: Reels can be scheduled up to 29 days in advance. If the queue goes beyond 29 days, the batch will safely stop.
For transparency and troubleshooting, the uploader follows Meta's 4-step upload flow:
-
Initialize Session:
upload_phase=startis sent to get avideo_idand an upload URL. -
Binary Upload: The physical
.mp4file is securely transmitted via OAuth stream. -
Finish & Metadata:
upload_phase=finishis sent with the title, description, andscheduled_publish_time. -
Status Polling: The tool actively polls the Meta API until
publishing_phase.statusiscomplete(whetherpublishedorscheduled), ensuring your video was accepted without errors.
If you stop the script halfway or an upload gets stuck in processing, running the tool again will safely resume operations. It checks existing fb_upload_status fields (like uploaded or pending) and asks Meta for the current state (e.g., updating it to published or scheduled).
- YouTube Auto-Upload — Cross-post to YouTube Shorts
- CLI Reference — Pipeline options