diff --git a/app.py b/app.py index 07fb810..2796671 100644 --- a/app.py +++ b/app.py @@ -36,6 +36,16 @@ os.makedirs(OUTPUT_DIR, exist_ok=True) # Default to 1 if not set, but user can set higher for powerful servers MAX_CONCURRENT_JOBS = int(os.environ.get("MAX_CONCURRENT_JOBS", "5")) MAX_FILE_SIZE_MB = 2048 # 2GB limit + +# How TikTok receives our uploads. MEDIA_UPLOAD lands the video in the user's +# TikTok drafts so they finish the post inside TikTok's own editor; DIRECT_POST +# publishes straight to their feed, which is Upload-Post's default. +# +# Drafts are the safer default for an automated pipeline: nothing reaches an +# audience without the account owner seeing it first, and TikTok's own editor is +# where covers, sounds and hashtags actually get chosen. The UI must say so — +# a user who expects a published post and finds a draft will read it as a bug. +TIKTOK_POST_MODE = os.environ.get("TIKTOK_POST_MODE", "MEDIA_UPLOAD").strip() JOB_RETENTION_SECONDS = int(os.environ.get("JOB_RETENTION_SECONDS", "3600")) # job/file retention (issue #46) # Ceiling for the working directory once it lives on a persistent volume: the # age-based sweep alone can't stop a burst of long videos from filling the disk. @@ -2552,6 +2562,7 @@ async def post_to_socials(req: SocialPostRequest, request: Request): # Add Platform specifics if "tiktok" in req.platforms: data_payload["tiktok_title"] = final_description + data_payload["post_mode"] = TIKTOK_POST_MODE if "instagram" in req.platforms: data_payload["instagram_title"] = final_description @@ -3425,6 +3436,7 @@ async def saasshorts_post_to_socials(req: SaaSPostRequest, request: Request): if "tiktok" in req.platforms: data_payload["tiktok_title"] = final_description + data_payload["post_mode"] = TIKTOK_POST_MODE if "instagram" in req.platforms: data_payload["instagram_title"] = final_description data_payload["media_type"] = "REELS" diff --git a/dashboard/src/components/ResultCard.jsx b/dashboard/src/components/ResultCard.jsx index cfea6b4..4551c53 100644 --- a/dashboard/src/components/ResultCard.jsx +++ b/dashboard/src/components/ResultCard.jsx @@ -849,6 +849,22 @@ export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostK )} + {/* TikTok is sent as a draft, so say so before they press publish: + someone expecting a live post and finding nothing on their + profile will read it as a failure. Lead with the upside — + posting from inside the app is what the algorithm rewards. */} + {platforms.tiktok && ( +
+ +
+ tiktok arrives as a draft, not a live post — you'll + get a notification in the app. finishing it there lets you add trending + sounds, effects and hashtags, which reaches more people than posting + straight from an api. +
+
+ )} +
{/* Title & Description */}
diff --git a/dashboard/src/components/SaaShortsTab.jsx b/dashboard/src/components/SaaShortsTab.jsx index 85c4db8..9026c09 100644 --- a/dashboard/src/components/SaaShortsTab.jsx +++ b/dashboard/src/components/SaaShortsTab.jsx @@ -1397,6 +1397,16 @@ export default function SaaShortsTab({ geminiApiKey, elevenLabsKey, falKey, uplo })} /> + {/* Same notice as ResultCard: TikTok lands as a draft, + and finding nothing live reads as a failed post. */} + {publishPlatforms.tiktok && ( +

+ tiktok arrives as a draft and you'll get a + notification in the app — finishing it there lets you add trending sounds + and hashtags, which reaches more people than posting from an api. +

+ )} + {/* Schedule toggle */}