Youtube Description Autoposter
by @robj1925
Generate SEO-optimized YouTube chapters, descriptions, and hashtags from a video URL or transcript file, and optionally post the metadata to the video.
clawhub install yt-description-autoposterπ About This Skill
name: yt-timestamp-autoposter description: Generate SEO-optimized YouTube timestamps from a YouTube URL or a raw transcript string, then optionally append them to the description of that specific video or your latest upload. Use when you need to create chapters for a YouTube video. Also use when the user asks to generate timestamps, append timestamps to YouTube, or process transcript text.
YouTube Timestamp Generator & Auto-Poster
Transforms a YouTube URL or a raw transcript string into SEO-optimized timestamps (chapters) powered by Gemini. Optionally appends the result directly to the description of a specific YouTube video or your latest upload via the YouTube Data API.
β οΈ Requirements Checklist
Before using this skill, ensure you have:
pip install youtube-transcript-api google-generativeai google-auth-oauthlib google-api-python-clientcredentials.json placed in scripts/ *(only required for --post β download from Google Cloud Console as an OAuth 2.0 Desktop App client)*Features
--latest mode checks for existing timestamps before attempting to generate new onesQuick Start
Mode 1 β YouTube URL
Fetches the transcript from the video, generates SEO timestamps, and optionally appends them to the description of that specific video.# Generate only (view output)
python scripts/youtube_desc_generator.py --url "" ""Generate and post to that video
python scripts/youtube_desc_generator.py --url "" "" --post
Mode 2 β Raw Transcript Text
Reads a raw transcript string, generates SEO timestamps, and optionally appends them to the description of your latest YouTube upload.
# Generate only (view output)
python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." ""Generate and post to latest video
python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "" --post
Mode 3 β Latest Video
Automatically fetches your most recent video, checks if timestamps already exist (to prevent duplicates), downloads the transcript, generates SEO timestamps, and optionally appends them to the description.# Generate and post timestamps for your latest video (if they don't already exist)
python scripts/youtube_desc_generator.py --latest "" --post
Examples:
python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY"
python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" --post
python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "$GEMINI_API_KEY" --post
Raw Transcript Text Format
When using --transcript, the transcript must be a string with timestamps in MM:SS format, separated by newlines:
0:00 Welcome to this video about AI agents.
0:12 Today we're going to cover what an AI agent actually is.
1:00 Let me show you a live demo of an agent booking a flight.
...
Natural Language Command Mapping
When the user speaks naturally, map their intent to the correct command using the table below. Always extract the YouTube URL or transcript text from their message and substitute it into the command.
| What the user says | Command to run |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| "Create timestamps for my latest video" | python scripts/youtube_desc_generator.py --latest "$GEMINI_API_KEY" --post |
| "Generate timestamps for this video: https://youtu.be/abc123" | python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" |
| "Create SEO chapters from this YouTube link: https://youtu.be/abc123" | python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" |
| "Give me the timestamps for this video: https://youtu.be/abc123" | python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" |
| "Generate timestamps for this video and post it: https://youtu.be/abc123" | python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" --post |
| "Generate SEO timestamps and post them back to this video: https://youtu.be/abc123" | python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" --post |
| "Process this transcript text: 0:00 Welcome..." | python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "$GEMINI_API_KEY" |
| "Generate timestamps from my transcript text: 0:00 Welcome..." | python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "$GEMINI_API_KEY" |
| "Process my transcript text and post it to my latest video: 0:00 Welcome..." | python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "$GEMINI_API_KEY" --post |
| "Generate timestamps from my transcript and upload to YouTube: 0:00 Welcome..." | python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "$GEMINI_API_KEY" --post |
Decision Rules
Use these rules to determine which command to run when the intent is ambiguous:
--latest mode--url mode--transcript mode--post flag (Note: commands like "create timestamps for my latest video" imply updating it, so --post is added)--post β generate and print only, do not touch YouTube--transcript --post and --latest --post β always targets the latest upload on the channel--url --post β always targets that specific videoGenerated Output
The script returns a single clean block β no labels or extra text:
0:00 with keyword-rich labels and SEO suffix tags (e.g. (Tutorial), (Overview), (2026))> Important: Output only the final timestamps. Do not include any introductory sentences, headings, labels, preamble, or commentary before or after the output.
How It Works
URL mode:
1. Extracts the video ID from the provided YouTube URL
2. Fetches the English transcript via youtube-transcript-api
3. Formats the transcript with MM:SS timestamps
4. Sends a prompt to Gemini for timestamps
5. Prints the timestamps
6. _(With --post)_ Authenticates via OAuth2 and appends the new timestamps to that specific video's description
Transcript mode:
1. Reads the provided raw transcript text string
2. Sends a prompt to Gemini for timestamps
3. Prints the timestamps
4. _(With --post)_ Authenticates via OAuth2, finds your latest upload, and appends the new timestamps to its description
OAuth Setup (for --post only)
1. Go to Google Cloud Console
2. Create a project and enable the YouTube Data API v3
3. Create OAuth 2.0 credentials (Desktop App type)
4. Download the file as credentials.json and place it in scripts/
5. On first run with --post, a browser window will open for you to authorize access
6. A token.pickle file will be saved automatically for future runs
Troubleshooting
No transcript available (URL mode):
--transcript mode with a manually prepared transcript stringTranscript text not loading (transcript mode):
MM:SS text formatGemini API errors:
gemini-3.1-flash-lite-preview--post not updating the video:
credentials.json is in the scripts/ directorytoken.pickle and re-authenticate if credentials have expiredWrong video appended to in transcript mode:
--url mode insteadPrivacy & Safety
β οΈ Important: The --post flag will append timestamps to a video's description automatically without manual confirmation in the CLI.
token.pickle β keep this file secureπ‘ Examples
Mode 1 β YouTube URL
Fetches the transcript from the video, generates SEO timestamps, and optionally appends them to the description of that specific video.# Generate only (view output)
python scripts/youtube_desc_generator.py --url "" ""Generate and post to that video
python scripts/youtube_desc_generator.py --url "" "" --post
Mode 2 β Raw Transcript Text
Reads a raw transcript string, generates SEO timestamps, and optionally appends them to the description of your latest YouTube upload.
# Generate only (view output)
python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." ""Generate and post to latest video
python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "" --post
Mode 3 β Latest Video
Automatically fetches your most recent video, checks if timestamps already exist (to prevent duplicates), downloads the transcript, generates SEO timestamps, and optionally appends them to the description.# Generate and post timestamps for your latest video (if they don't already exist)
python scripts/youtube_desc_generator.py --latest "" --post
Examples:
python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY"
python scripts/youtube_desc_generator.py --url "https://youtu.be/abc123" "$GEMINI_API_KEY" --post
python scripts/youtube_desc_generator.py --transcript "0:00 Welcome..." "$GEMINI_API_KEY" --post
π Tips & Best Practices
No transcript available (URL mode):
--transcript mode with a manually prepared transcript stringTranscript text not loading (transcript mode):
MM:SS text formatGemini API errors:
gemini-3.1-flash-lite-preview--post not updating the video:
credentials.json is in the scripts/ directorytoken.pickle and re-authenticate if credentials have expiredWrong video appended to in transcript mode:
--url mode instead