Spaces:
Running on Zero
Running on Zero
File size: 2,082 Bytes
3249e1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """Caption & CTA builder (templates only, no AI model). Based on post-pack-001.md."""
PLATFORMS = ["TikTok", "Instagram", "YouTube Shorts", "X", "Facebook", "Pinterest"]
CTA_LINE = "KING OF MUSIC©️ · Stream 24/7 · Buy on DistroKid · youtube.com/ChadSyphrett · instagram.com/InternetThemePark"
BASE_TAGS = ["#KINGOFMUSIC", "#ChadSyphrett", "#lofi", "#hiphop", "#newmusic", "#musicvideo"]
LIMITS = {"X": 280, "TikTok": 2200, "Instagram": 2200, "YouTube Shorts": 5000, "Facebook": 63206, "Pinterest": 500}
def build_caption(platform, song, hook, extra_tags="", store_link="", business_line=""):
song = (song or "").strip() or "KUNG FU COFFEE"
hook = (hook or "").strip() or "New music from the KING OF MUSIC©️ 👑"
tags = BASE_TAGS + [t if t.startswith("#") else "#" + t for t in (extra_tags or "").replace(",", " ").split() if t]
link = (store_link or "").strip() or "DistroKid"
if platform == "X":
text = f"{hook}\n🎵 {song}\n🛒 {link}\n" + " ".join(tags[:3])
elif platform == "TikTok":
text = (f"{hook}\n🎵 \"{song}\" — KING OF MUSIC©️\nStream on YouTube, buy on DistroKid, hang at Internet Theme Park.\n"
f"youtube.com/ChadSyphrett · {link} · instagram.com/InternetThemePark\n" + " ".join(tags))
elif platform == "YouTube Shorts":
text = (f"{song} | KING OF MUSIC©️ #Shorts\n\n{hook}\n\n🛒 Buy/stream: {link}\n📺 youtube.com/ChadSyphrett\n"
f"📸 instagram.com/InternetThemePark\n\n" + " ".join(tags + ["#Shorts"]))
elif platform == "Pinterest":
text = f"{song} — KING OF MUSIC©️. {hook} Stream 24/7 at youtube.com/ChadSyphrett. Buy: {link}."
else:
text = f"{hook}\n\n🎵 {song}\n🛒 Music: {link}\n📺 youtube.com/ChadSyphrett\n\n{CTA_LINE}\n\n" + " ".join(tags)
if (business_line or "").strip():
text += "\n" + business_line.strip()
limit = LIMITS.get(platform, 2200)
note = f"{len(text)}/{limit} characters" + (" ⚠️ over the limit, shorten the hook" if len(text) > limit else "")
return text, note
|