OpenCode LinkedIn post generator: one video, five variants
Watch on YouTube ↗ Subscribe on YouTube ↗
Written guide: OpenCode: Turn a YouTube Video into LinkedIn Posts
Build a script with OpenCode and DeepSeek V4 Flash that turns a video, from YouTube or a local file, into five LinkedIn post variants. OpenCode trims videos to two minutes with FFmpeg, then writes a Node.js script that gets a transcript with yt-dlp captions or Whisper and asks ChatGPT 5.4 for thought leadership, storytelling, listicle, hot take and question posts. Posting stays manual. The sign-up link is an affiliate link.
Video summary
OpenCode tutorial for generating LinkedIn posts from YouTube videos in minutes, not hours.
The video covers 10 parts: Introduction to OpenCode Go, Batch Trim Videos with FFmpeg, Build a YouTube Video Transcript Scraper, Generate OpenAI API Secret Keys, DeepSeek V4 Flash Code Review, Debug Script Errors & Dependencies, Test Node.js Video Transcript Parser, Generate 5 Copywriting Content Variants, Optimize Formatting for LinkedIn Engagement, and OpenCode Go Token Credit Tracking.
What this video covers
What you build
A Node.js script that extracts a transcript, writes five LinkedIn post variants into one file and applies LinkedIn formatting rules such as a hook, short lines and tighter hashtags.
Tools used
Key steps
- 1:02 - Trim videos to two minutes for LinkedIn by telling OpenCode to run FFmpeg.
- 1:38 - Ask for a script that gets transcripts from YouTube or local videos and writes posts, and answer its clarifying questions.
- 2:08 - Create an OpenAI API key and keep it in the environment file.
- 3:26 - Fix a missing OpenAI import and heavy package installs.
- 4:49 - Test the Node.js script on a video, since it chose Node instead of the Python asked for.
- 6:04 - Generate five post variants and merge them into a single file.
- 8:42 - Rewrite the prompt for LinkedIn engagement with a hook first and short lines.
Not covered
- Automatic posting to LinkedIn, which is manual.
- Which variant performs best, since no engagement results are shown.
- Total cost. The spoken spend figure is unclear, and Mike reports 6 percent of the day's and 19 percent of the month's OpenCode Go usage.
- The lost earlier output files, which Mike notes were deleted by a script change.
In this video
- 0:00 Introduction to OpenCode Go
- 1:02 Batch Trim Videos with FFmpeg
- 1:38 Build a YouTube Video Transcript Scraper
- 2:08 Generate OpenAI API Secret Keys
- 2:32 DeepSeek V4 Flash Code Review
- 3:26 Debug Script Errors & Dependencies
- 4:49 Test Node.js Video Transcript Parser
- 6:04 Generate 5 Copywriting Content Variants
- 8:42 Optimize Formatting for LinkedIn Engagement
- 11:13 OpenCode Go Token Credit Tracking
Questions and answers
Why Node.js instead of Python?
OpenCode chose Node.js on its own. Mike would have preferred Python but kept it.
Which post styles does it make?
Thought leadership, storytelling, listicle, hot take and question, all saved in one file.
Keep learning
Transcript
Hey there, welcome to the channel. In this video, I'm going to be taking you through how to create a custom script which will automatically create LinkedIn posts from your videos that could either be on YouTube or on your local directory. And we're going to be using OpenCode to do this. So, I've got the website pulled up here. They have free plans as well as the paid Go plan, which is $10 per month.
I've just recently subscribed to the Go plan, so I get access to all of these different models, including GLM, Quinn, Kimi, Mimo, uh, Miniax, Deepseek, and many more. Check the link in the description below. You can sign up and you will get $5 in credits, and I will also get $5 in credits. I've already got OpenCode running over here in the terminal and I've just told it to create a script which grabs the transcript from user supplied videos and creates professional LinkedIn posts using chatpt 5.4
Read the rest of the transcript
and then put them into files for easy posting and then it just simply asks me a few clarifying questions like where are the videos coming from? I want them to come from both YouTube and also the local files that I have on my system over here. These have already been trimmed down to 2 minutes long for easy posting on LinkedIn. And I also used OpenCode to do that over here as well. It just runs ffmpeg and trims down all of the videos quickly and easily.
All you have to do is tell it to trim all the latest videos in your directory to 2 minutes for LinkedIn and it will go ahead and create the videos as it's done over here. It's going to create the Python script and it's also going to create multiple variants per video as well. So now it's just going to ask a few more clarifying questions. Looks like it's already got the script ready to go. It's going to be using YTDLP to get the captions.
It's just going to grab the transcripts and then it's going to create the posts. So this is ultimately going to save me time creating posts on LinkedIn, which is exactly what I want. And now I can just say, "Looks good. Go ahead and write it." And it will start creating the script right away. So it's just going to create the post script right there. It's writing the script now. And then it will probably ask for my OpenAI API key.
In order to get your API key, you just come to platform.openai.com. And then you can come on down to API keys here. And you can create a new secret key. So in this case, I'm just going to call it LinkedIn. And then we can copy this key right here, which we're going to need to paste in later for it to create the script. Looks like it's already getting to work building out the script. And this is what it looks like.
So, I was able to create this Python script within a couple seconds. Didn't take very long at all using DeepSseek V4 Flash, which is part of the OpenCode Go plan. So, if you want to choose your model, you just do back slashmodels and you can choose from a lot of different models over here on both Zen. These ones are free and also OpenCode go if you decide to upgrade. Again, link in the description below where you can sign up and get $5 in credits.
And we could just tell it to find the open API API key in the EMV file. It's just going to be able to pull it in. So now it should pull in the API key. And then we can just go ahead and run this on a particular video. Make sure it's all updated over here. It's already got the API key. So now we're just going to go ahead and run this. And looks like I am getting an error here.
I'm just going to go ahead and tell it to fix this build error. And then it will fix that up in the Python script real quick. And it just needs to import OpenAI right here, which it should be able to fix up real quick. And it's also grabbing Whisper, which is a package to translate videos into transcripts. And now it's just going ahead and fixing up that error in the Python script. And it should be able to import the OpenAI module.
Uh, it looks like it installed all the packages. You can see over here inside the Python lib folder in LinkedIn Post creator, it's creating all of these different packages. I don't really know why it needs all of these. It's actually taking up a lot of space, too. This is like 5 gigabytes almost. I don't want to get YouTube videos. I just want to run this locally on my computer. Otherwise, it's going to install a whole bunch of packages which I don't really want or need.
So, I'm just going to go ahead and run this prompt. And now it's going to create the Python script. It's probably going to ask me some clarifying questions. I've already got the&env file. So that's no big deal. It's going to pull in the API key for ChatGPT. It's going to test the script now on a particular YouTube video and see if it can get the transcript and also generate the post.
So we can see over here we now have a post ready to go for LinkedIn on a test video. In this case, it's actually creating a node script. So, it's not using Python. And now, if I want to provide it with one of my YouTube videos or a local file on my machine, I can say run this on videos LinkedIn. And then we're going to give it OpenCode tutorial.mpp4.
And it should be able to run the script and create the LinkedIn post over here quickly and easily. Looks like it needs to modify the script a little bit more to allow for local files and then should create the LinkedIn post over here. And then I can simply come over to LinkedIn, upload the video as I've already done here, and then create the post quickly and easily. So this is ultimately going to save me time.
In this case, I'm using DeepSeek V4 Flash, which is one of the OpenCode models. This is on the paid plan. It's $10 per month. you get access to all these different models which works great. So this is what it came up with. Excited to dive into the world of open source AI coding. OpenCode might just be your next goto tool. Imagine blah blah blah blah blah.
So now if I if I wanted to create multiple variants of the post uh using CHP I could say create multiple variants of the post using CHP modify the script because I don't necessarily like that. I want to see a couple different posts which I can then turn around and decide which one to post on LinkedIn. And sure enough, it just went ahead and modified the NodeJS script, which is index.js.
And if we want to take a look at that, we can just open it up right here. This is what the script looks like currently. Could be even better. I actually want to create a Python script, but it decided to use Node.js instead. And now it should be creating the post variants. So now it's created the five variants uh for thought leadership, storytelling, listical, hottake, and question. In the terminal, you can see it's extracting the audio with ffmpeg. It's transcribing it with uh open AAI whisper.
And now it's creating the transcript and it's generating all five variants of the post. So again, if we come over here, we can see all the different variants. I actually just want to put that in a single file. I don't want it to create multiple files with the variants. Don't create multiple files for each variant. Harnessing the power of truly open source AI tools like OpenCode can revolutionize how we approach coding. I can just come over here to LinkedIn and we can post that.
And I'm just going to go ahead and post it with the video attached. It created all the five variants in a single file and actually just went ahead and deleted my other ones which isn't exactly what I wanted, but that's okay. Now we've got all of the variants over here for thought leadership, storytelling, a listical, hottake, as well as a question. And then you can simply decide which one you like most. And then we can come over here.
We can say run the script on this particular YouTube video. And now it's going to do the exact same thing. It'll start the Node.js script. It's going to process it, get the transcript, generate the variants, and boom, it's already done. That literally took seconds. And now I've got multiple variants over here, which I can use for that video. Ultimately, this is the main goal for using these AI tools. It's to save you time and money.
So, you don't have to hire virtual assistants to do this stuff for you. You can just write a simple script and generate the LinkedIn post and upload them as I've just done over here. So, I just went ahead and posted that on LinkedIn. I'm going to say optimize the post for LinkedIn using the best practices to get more engagement.
And what that's going to do is it's just going to do some research probably by searching the web and it's going to find the best practices for LinkedIn posts. it will optimize them for engagement and that way we can kind of make this look a little bit better so it's not so wordy and it's broken up and it's using the best format for posting on LinkedIn and again I'm just using the DeepS v4 flash which I'm really impressed with.
This is a Chinese model which is very very fast and it's built directly into OpenCode Go. So, it just went ahead and modified that script. And now we can open that up. And right away I can tell this is already better formatted for LinkedIn. It also shows over here what exactly it did. So the post are now formatted for maximum LinkedIn engagement. Here's the key changes to the prompt. So it's got the hook first, which is definitely what we want on LinkedIn.
Each variant opens with a pattern interrupt. It's got line by line. So, like I say, each sentence phrase gets its own line for mobile skimming, so it's not all bulky and easier to read. It's also got short lines, only four 40 characters max per line, so nothing gets caught up cut off on mobile. It's got some emojicons in there. It's got tighter hashtags, character target, no markdown, and stronger CTAs. That's exactly what I want.
And now I just want to find which post looks best over here. So, I'm just going to go ahead and modify this post. And as you can see, it looks a lot better right off the bat. I like that a lot better. So, we're just going to modify the post. And now it has the video, which is only 2 minutes long. In order to do that, I also used OpenCode to just trim all the videos in my uh YouTube videos directory.
So, I just created a custom script to download all my YouTube videos. And then I just told it to go ahead and trim them and create the LinkedIn videos over here. So, these are all about 2 minutes long. And now it's also just gone ahead and created another five variants over here for my YouTube video, which I was able to feed in to the script and it got the transcript. It summarized it. It created all the variants within a couple seconds.
So, now I have this ready to go. And if I wanted to create a post on LinkedIn for that, I could just go ahead and upload that video, create the post over here quickly and easily using OpenCode. And this is essentially costing me $0 to run this. I spent 58 on DeepSeek V4 Flash to create this script and to generate the post. So it essentially cost me nothing. And that is built directly into OpenCode Go.
It's $10 a month and I used very very few credits so far today, only 6%. And I've still got 19% usage for the month. So with that being said, thank you so much for watching this tutorial. Please also go ahead and check out my website where you can book a free consultation call. You can also calculate over here how much time saving and money you're going to save based on the number of people on your team and the hours wasted per week and your average uh
salary for each employee. Go ahead, book your free consultation call and also go ahead and check out my Skool community. It's growing fast. I just recently rebranded it. It's now called AI Income Lab. I offer free plans as well as paid plans starting at $9 per month. You can go ahead take a look around the classroom for all of the tutorials, courses, and resources, as well as introduce yourself inside the community. We're getting new people joining every single day.
We'd love to see you inside the Skool community. And with that being said, thanks so much for watching this video. Please go ahead, subscribe to the channel if you haven't already. Take care. Stay safe. Peace from Thailand. Signing off. I'll see you in the next one.



