On a schedule
Publish videos from a Drive folder with AI titles and a Telegram ping
Drop a video into a Drive folder and it goes to YouTube with an AI-written title and description, with a Telegram message when it is live.
- Runs
- On a schedule
- Apps
- Telegram, YouTube
- AI
- Yes, uses the built-in AI allowance
- Access
- youtube.upload; bot token
Send this to your assistant
Create a ClickRuntime automation: every hour, check my 'To publish' Drive folder for new videos. Write a title and description with AI from the file name, upload each to YouTube, and send me the link on Telegram.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A solo creator edits videos on a laptop and saves the finished files to a Drive folder. Uploading, writing titles and filling in descriptions is the part they keep putting off, so finished videos sit in the folder for days.
Watching the folder and publishing whatever lands in it means finishing the edit is the last thing the creator has to do.
What you get out of it
Finished means published
Saving the file to the folder is the only step after editing.
Titles and descriptions drafted for you
AI writes them from the file name, which you can name with the topic in mind.
A ping on your phone
Telegram confirms each upload with the link, so you know it went through.
Each file once
Files already uploaded are remembered and never published twice.
How it works
What happens, step by step
Every hour, ClickRuntime checks your Drive folder for video files it has not published yet.
AI writes a title and description for each one from its file name.
The video is uploaded to your YouTube channel.
You get a Telegram message with the title and link, and the file is remembered so it is not uploaded again.
Before it runs live
- Connect Telegram
- 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 Telegram and YouTube steps into one automation
Under the hood
The code that runs this automation
import io
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, report_fetched, credentials, ai, state
def api(name, version):
return build(name, version, credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
CHAT_ID = "123456789"
def tg(method, **params):
r = http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=params)
return r.raise_for_status() or r.json()["result"]
FOLDER_ID = "your-drive-folder-id"
@on_trigger
def run(event):
done = set(state.get("done") or [])
files = api("drive", "v3").files().list(q=f"'{FOLDER_ID}' in parents and mimeType contains 'video/' and trashed=false", fields="files(id,name)").execute()["files"]
new = [f for f in files if f["id"] not in done]
report_fetched(len(new))
if not new:
return {"summary": "No new videos"}
for f in new:
meta = ai.generate(f"File name: {f['name']}", system="Write a YouTube title (max 90 chars) and a 3-sentence description.",
json_schema={"type": "object", "properties": {"title": {"type": "string"}, "description": {"type": "string"}}}, max_output_tokens=250).json
data = api("drive", "v3").files().get_media(fileId=f["id"]).execute()
video = api("youtube", "v3").videos().insert(part="snippet,status", body={"snippet": meta, "status": {"privacyStatus": "public"}},
media_body=MediaIoBaseUpload(io.BytesIO(data), mimetype="video/mp4", resumable=True)).execute()
tg("sendMessage", chat_id=CHAT_ID, text=f"📺 {meta['title']}\nhttps://youtu.be/{video['id']}")
done.add(f["id"])
state.set("done", sorted(done))
return {"published": len(new)}FAQ
Common questions
How should I name the files?
Can it upload as private?
What about large files?
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
Get new YouTube uploads from your favourite channels in Telegram
Every new video from the channels you follow is posted to your Telegram chat or channel with its title and link.
See how it worksSend a YouTube link to Telegram and get a summary back
Share a YouTube link with your Telegram bot and it replies with a short summary and the key points.
See how it worksUpload finished Shorts to YouTube and hear about it on Telegram
When your video tool finishes a Short, it goes up to YouTube with an AI-written title and Telegram tells you it is live.
See how it worksKeep exploring
Set up “Publish videos from a Drive folder with AI titles and a Telegram ping” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.