Update app.py
Browse files162 unmodified lines16316416516616716816917017117284 unmodified lines257258259260261262263492 unmodified lines756757758759760761762763764765162 unmodified lines"3. The core issue explained concisely (the key detail that drives the conflict).\n""4. The stakes for the industry or investors.\n""5. A rhetorical question that builds anticipation.\n""6. A clear callβtoβaction that includes the source domain (e.g., 'Check the full details on chainstreet.i o').\n\n""Write in a conversational, authoritative newscaster style that will sound natural when spoken aloud.\n""Write exactly {n} lines, each a single, punchy sentence (8β15 words). The last line MUST be the callβtoβaction using the source domain from the content if available; otherwise use a generic CTA.\n""Output ONLY the {n} lines, one per line, no extra text.105 β 115 words or 580 β 650 characters"),}84 unmodified linesreturn lines[:num_points]# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ# AUDIO β Edge TTS# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββasync def _edge_save(text: str, voice: str, path: str) -> None:import edge_tts # lazy β avoid slow startup492 unmodified linesif not sentences:return None, "β Script is empty. Please generate a script first."full_script = " ".join(sentences)if not full_script.strip():return None, "β Generated script is empty. Please check your content or try again."print(f"[create_video] Full script length: {len(full_script)} chars")# Log sentences for debugging162 unmodified lines16316416516616716816917017117284 unmodified lines257258259260261262263492 unmodified lines756757758759760761762763764162 unmodified lines"3. The core issue explained concisely (the key detail that drives the conflict).\n""4. The stakes for the industry or investors.\n""5. A rhetorical question that builds anticipation.\n""6. A clear callβtoβaction that includes the source domain (e.g., 'Link in bio β check it before the deadline hits').\n\n""Write in a conversational, authoritative newscaster style that will sound natural when spoken aloud.\n""Write exactly {n} lines, each a single, punchy sentence (8β15 words). The last line MUST be the callβtoβaction using the source domain from the content if available; otherwise use a generic CTA.\n""Output ONLY the {n} lines, one per line, no extra text."),}84 unmodified linesreturn lines[:num_points]# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ# AUDIO β Edge TTS (improved with retry and fallback)# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββasync def _edge_save(text: str, voice: str, path: str) -> None:import edge_tts # lazy β avoid slow startup492 unmodified linesif not sentences:return None, "β Script is empty. Please generate a script first."full_script = " ".join(sentences)if not full_script.strip():return None, "β Generated script is empty. Please check your content or try again."print(f"[create_video] Full script length: {len(full_script)} chars")# Log sentences for debugging
app.py+5-6