YouTube Content Generator
Relevant source files
The following files were used as context for generating this wiki page:
- ToBeMigrated/ai_writers/youtube_writers/modules/script_generator.py
- ToBeMigrated/ai_writers/youtube_writers/modules/description_generator.py
- ToBeMigrated/ai_writers/youtube_writers/modules/title_generator.py
- ToBeMigrated/ai_writers/youtube_writers/modules/community_post_generator.py
- ToBeMigrated/ai_writers/youtube_writers/modules/README_yt_shorts_scripts.md
- ToBeMigrated/ai_writers/youtube_writers/modules/README_Thumbnail_Generator.md
- ToBeMigrated/ai_writers/youtube_writers/modules/README_endScreen.md
The YouTube Content Generator is a specialized suite of AI-powered modules designed to automate and optimize the creation of various YouTube-specific assets. This system spans from high-level video conceptualization to the generation of video scripts, SEO-optimized titles and descriptions, community engagement posts, and visual assets like thumbnails and end screens.
By leveraging Large Language Models (LLMs) and specialized prompt engineering, the generator ensures that content is tailored to specific target audiences, niche categories, and engagement goals. The module is integrated within the broader ALwrity platform, providing a cohesive workflow for digital content creators to manage their video production lifecycle.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/script_generator.py, README.md:120-135
System Architecture and Module Overview
The system is structured as a collection of specialized modules, each responsible for a distinct part of the YouTube content ecosystem. These modules utilize a shared llm_text_gen utility to interact with various AI providers.
The diagram shows the modular flow where user inputs are routed through specific generators to produce final YouTube assets.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/script_generator.py:165-170, ToBeMigrated/ai_writers/youtube_writers/modules/README_Thumbnail_Generator.md:10-30
Video Script Generation
The Script Generator module produces structured video scripts based on user-defined parameters such as audience, tone, and specific narrative structures.
Supported Script Structures
The module explicitly supports several narrative frameworks:
- Problem-Solution: Focuses on resolving a specific pain point.
- Before-After-Bridge: Shows transformation and the process to achieve it.
- Step-by-Step Tutorial: Sequential instructions.
- Case Study: Real-world examples.
- Interview/Review/Vlog/Educational/Entertainment: Specialized formats for different genres.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/script_generator.py:31-43
Script Components and Logic
The generation process utilizes a system_prompt that enforces roleplay as a "YouTube script expert" and restricts output to the script text only.
| Parameter | Description |
|---|---|
include_hook | Adds an attention-grabbing intro. |
include_cta | Includes a call to action at the end. |
include_engagement | Prompts for polls or questions within the video. |
include_timestamps | Suggests video segment timing. |
include_visual_cues | Provides transitions and director notes. |
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/script_generator.py:49-62
# ToBeMigrated/ai_writers/youtube_writers/modules/script_generator.py:100-110
try:
response = llm_text_gen(prompt, system_prompt=system_prompt)
return response
except Exception as err:
st.error(f"Error: Failed to get response from LLM: {err}")
return None
Metadata and SEO Optimization
The generator includes dedicated modules for titles and descriptions, featuring built-in analysis tools to measure SEO effectiveness and click-through potential.
Title Generation and Analysis
The Title Generator creates catchy, keyword-rich options and analyzes them against several metrics:
- Optimal Length: Checks for 50–60 characters.
- Clickbait Detection: Scans for phrases like "shocking" or "you won't believe."
- SEO Scoring: Assigns points for numbers, questions, colons, and brackets.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/title_generator.py:19-90
Description Generation
The Description Generator focuses on natural keyword integration and metadata enrichment. It calculates a Keyword Density and an SEO Score (capped at 10) based on word count (target 250–300 words), CTA phrases, hashtags, and links.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/description_generator.py:15-60
Visual Assets and Engagement
Beyond text content, the system generates visual concepts and community-focused interactions.
Thumbnail and End Screen Generation
The Thumbnail Generator utilizes Gemini AI for high-quality image generation. It provides concept generation, style customization (Photorealistic, Artistic, 3D Render), and iterative refinement through natural language instructions.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/README_Thumbnail_Generator.md:15-45
The End Screen Generator focuses on the final 20 seconds of a video, providing concepts for subscribe buttons, playlists, and social media handles.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/README_endScreen.md:10-25
Community Post Generator
This module generates posts for the YouTube Community tab, supporting types like Polls, Sneak Peeks, and Fan Spotlights.
The diagram represents the analytical pipeline for community posts to ensure high engagement.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/community_post_generator.py:112-200
Technical Configuration Summary
| Feature | Supported Options / Metrics | File Reference |
|---|---|---|
| Languages | English, Spanish, French, German, Russian, etc. | script_generator.py:205 |
| Export Formats | Text, Markdown, HTML, JSON, Subtitles (SRT) | script_generator.py:125-150 |
| Image Styles | Realistic, Illustration, Minimalist, Photographic | README_Thumbnail_Generator.md:25 |
| SEO Score | Length, Keywords, CTAs, Hashtags, Links | description_generator.py:30 |
The YouTube Content Generator provides a comprehensive framework for video creators, combining narrative structure with data-driven SEO analysis and visual design to maximize platform performance.
Sources: ToBeMigrated/ai_writers/youtube_writers/modules/README_yt_shorts_scripts.md:150-180