Every hour
Add AI chapters to your new YouTube videos
New videos get timestamped chapters added to their description, and each one is logged in Airtable.
- Runs
- Every hour
- Apps
- Airtable, YouTube
- AI
- Yes, uses the built-in AI allowance
- Access
- YouTube youtube; Airtable write
Send this to your assistant
Create a ClickRuntime automation: every hour, check for new videos on my channel. Use the captions to write timestamped chapters with AI, add them to the video description, and log the video and chapters in my Chapters table in Airtable.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Chapters make long videos easier to navigate and can show up in Google search results, but writing them means scrubbing through the whole video noting times. On a channel publishing hour-long interviews every week, it rarely gets done.
Writing chapters from the captions and adding them to the description gives every video that boost, and the Airtable log shows which videos have them.
What you get out of it
Easier to watch
Viewers jump straight to the part they want, which keeps them watching longer.
Better in search
Google can show chapters as key moments, which brings in viewers searching for a specific topic.
No scrubbing through footage
Chapters come from the captions in minutes, not an hour of note-taking.
A record in Airtable
Each video and its chapters are logged, so you can check or reuse them.
How it works
What happens, step by step
Every hour, ClickRuntime checks your channel for new videos it has not handled.
It downloads the video's captions with their timings.
AI writes a list of chapters with start times from the captions.
The chapters are added to the video's description on YouTube and logged in your Chapters table in Airtable.
Before it runs live
- Connect Airtable
- Connect YouTube
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Airtable and YouTube steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state
def api(name, version):
return build(name, version, credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
AT = "https://api.airtable.com/v0/appXXXXXXXXXXXXXX"
def at(method, path, **kw):
r = http.request(method, f"{AT}/{path}", headers={"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}, **kw)
return r.raise_for_status() or r.json()
@on_trigger
def run(event):
yt, done = api("youtube", "v3"), set(state.get("done") or [])
uploads = yt.channels().list(part="contentDetails", mine=True).execute()["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
ids = [i["contentDetails"]["videoId"] for i in yt.playlistItems().list(part="contentDetails", playlistId=uploads, maxResults=5).execute()["items"]]
new = [v for v in ids if v not in done and yt.captions().list(part="id", videoId=v).execute().get("items")]
report_fetched(len(new))
if not new:
return {"summary": "No new videos with captions"}
for vid in new:
track = yt.captions().list(part="id", videoId=vid).execute()["items"][0]["id"]
srt = yt.captions().download(id=track, tfmt="srt").execute().decode()[:30000]
chapters = ai.generate(srt, system="Write 5-10 YouTube chapters as 'MM:SS Title' lines. The first must be 00:00.", max_output_tokens=300).text.strip()
s = yt.videos().list(part="snippet", id=vid).execute()["items"][0]["snippet"]
if "00:00" not in s["description"]:
yt.videos().update(part="snippet", body={"id": vid, "snippet": {"title": s["title"], "categoryId": s["categoryId"],
"description": f"{s['description']}\n\nChapters\n{chapters}"}}).execute()
at("POST", "Chapters", json={"records": [{"fields": {"Video ID": vid, "Title": s["title"], "Chapters": chapters}}]})
done.add(vid)
state.set("done", sorted(done)[-500:])
return {"chaptered": len(new)}FAQ
Common questions
Where do the captions come from?
Will it overwrite my description?
What if a video already has chapters?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Save new YouTube comments to Airtable
New top-level comments on your YouTube channel are added to an Airtable table every 15 minutes with the video, author, text, likes and a link.
See how it worksCollect new YouTube videos on your topics into Airtable
Each day, new videos on the topics you follow are summarised and saved as records in Airtable.
See how it worksPublish the next ready video from your Airtable queue
On schedule, the next video marked ready in Airtable is uploaded to YouTube and its record is updated with the link.
See how it worksKeep exploring
Set up “Add AI chapters to your new YouTube videos” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.