🚀 AUTO TREND SYSTEM (FULL PIPELINE)
🧠 1. System Flow
Trend Keywords → AI Script → Voice → Video → Title/Description → Upload Queue → n8n Auto পোস্ট
🔥 2. Trend Source (AUTOMATED)
Use
👉 VidIQ trend discovery system
But since VidIQ doesn’t have a public API, we simulate trend input via:
📁 3. Project Structure
auto_trend/
│── main.py
│── keywords.txt
│── assets/
│── output/
│── data/
│── .env
🧠 4. KEY FEATURE (AUTO TREND LOOP)
🧾 5. FULL PYTHON (AUTO TREND ENGINE)
import os
import random
import subprocess
from moviepy.editor import *
from dotenv import load_dotenv
import openai
load_dotenv()
openai.api_key = os.getenv("OPENAI_API_KEY")
USED_FILE = "data/used.txt"
# ===== LOAD KEYWORDS =====
def load_keywords():
with open("keywords.txt", "r", encoding="utf-8") as f:
return [k.strip() for k in f.readlines()]
def load_used():
if not os.path.exists(USED_FILE):
return set()
with open(USED_FILE, "r") as f:
return set(f.read().splitlines())
def save_used(keyword):
with open(USED_FILE, "a") as f:
f.write(keyword + "\n")
# ===== PICK TREND KEYWORD =====
def get_trend_keyword():
keywords = load_keywords()
used = load_used()
available = [k for k in keywords if k not in used]
if not available:
print("Reset keyword list...")
open(USED_FILE, "w").close()
return random.choice(keywords)
keyword = random.choice(available)
save_used(keyword)
return keyword
# ===== AI SCRIPT =====
def generate_script(keyword):
prompt = f"""
Create a viral TikTok/YouTube Shorts script about: {keyword}
Format:
Hook:
Build:
Value:
CTA:
Keep it fast, engaging, under 30 seconds.
"""
res = openai.ChatCompletion.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": prompt}]
)
return res.choices[0].message.content
# ===== TTS =====
def tts(script):
with open("script.txt", "w", encoding="utf-8") as f:
f.write(script)
subprocess.run([
"edge-tts",
"--text-file", "script.txt",
"--voice", "en-US-AriaNeural",
"--write-media", "voice.mp3"
])
# ===== VIDEO =====
def create_video():
clip = VideoFileClip("assets/bg.mp4").subclip(0, 30)
audio = AudioFileClip("voice.mp3")
video = clip.set_audio(audio)
txt = TextClip("TRENDING NOW 🔥", fontsize=60, color='white')
txt = txt.set_position("center").set_duration(30)
final = CompositeVideoClip([video, txt])
output = f"output/video_{random.randint(1,9999)}.mp4"
final.write_videofile(output, fps=24)
return output
# ===== TITLE =====
def generate_title(keyword):
return f"{keyword} 🔥 Trending Now!"
# ===== DESCRIPTION =====
def generate_description(keyword):
return f"""
{keyword} is blowing up right now!
Learn how to use it before it's too late.
#trending #ai #makemoney
"""
# ===== MAIN =====
if __name__ == "__main__":
keyword = get_trend_keyword()
print("TREND:", keyword)
script = generate_script(keyword)
tts(script)
video = create_video()
title = generate_title(keyword)
desc = generate_description(keyword)
print("VIDEO:", video)
print("TITLE:", title)
print("DESC:", desc)
⚙️ 6. KEYWORDS FILE (VERY IMPORTANT)
Fill keywords.txt with trends from:
👉 VidIQ keyword insights
Example:
ai side hustle 2026
chatgpt赚钱方法
tiktok growth hack
youtube automation
make money with ai tools
🔄 7. n8n AUTO WORKFLOW (DAILY)
Flow:
Cron → Run Python → Upload → Save → Repeat
Import JSON:
{
"nodes": [
{
"parameters": {
"cronExpression": "0 */3 * * *"
},
"name": "Every 3 Hours",
"type": "n8n-nodes-base.cron",
"position": [200, 300]
},
{
"parameters": {
"command": "python main.py"
},
"name": "Run Trend Engine",
"type": "n8n-nodes-base.executeCommand",
"position": [400, 300]
}
],
"connections": {
"Every 3 Hours": {
"main": [[{ "node": "Run Trend Engine" }]]
}
}
}
📈 8. HOW YOU SCALE THIS
LEVEL 1:
💰 9. ADD MONEY LAYER
🔥 Traffic → Email
Use
👉 email automation system
🔥 SEO traffic
Use
👉 SEO optimization tools
🔥 Trend engine
Use
👉 VidIQ trend system
⚠️ 10. PRO TIPS (IMPORTANT)
🎯 FINAL RESULT
This system gives you:
✅ Auto trending content
✅ Daily video output
✅ Scalable traffic
✅ Monetization ready
🧠 1. System Flow
Trend Keywords → AI Script → Voice → Video → Title/Description → Upload Queue → n8n Auto পোস্ট
🔥 2. Trend Source (AUTOMATED)
Use
👉 VidIQ trend discovery system
But since VidIQ doesn’t have a public API, we simulate trend input via:
Manual export (1 click/day)
OR keyword list file (auto rotation)
📁 3. Project Structure
auto_trend/
│── main.py
│── keywords.txt
│── assets/
│── output/
│── data/
│── .env
🧠 4. KEY FEATURE (AUTO TREND LOOP)
Reads trending keywords
Avoids duplicates
Saves used keywords
Runs continuously
🧾 5. FULL PYTHON (AUTO TREND ENGINE)
import os
import random
import subprocess
from moviepy.editor import *
from dotenv import load_dotenv
import openai
load_dotenv()
openai.api_key = os.getenv("OPENAI_API_KEY")
USED_FILE = "data/used.txt"
# ===== LOAD KEYWORDS =====
def load_keywords():
with open("keywords.txt", "r", encoding="utf-8") as f:
return [k.strip() for k in f.readlines()]
def load_used():
if not os.path.exists(USED_FILE):
return set()
with open(USED_FILE, "r") as f:
return set(f.read().splitlines())
def save_used(keyword):
with open(USED_FILE, "a") as f:
f.write(keyword + "\n")
# ===== PICK TREND KEYWORD =====
def get_trend_keyword():
keywords = load_keywords()
used = load_used()
available = [k for k in keywords if k not in used]
if not available:
print("Reset keyword list...")
open(USED_FILE, "w").close()
return random.choice(keywords)
keyword = random.choice(available)
save_used(keyword)
return keyword
# ===== AI SCRIPT =====
def generate_script(keyword):
prompt = f"""
Create a viral TikTok/YouTube Shorts script about: {keyword}
Format:
Hook:
Build:
Value:
CTA:
Keep it fast, engaging, under 30 seconds.
"""
res = openai.ChatCompletion.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": prompt}]
)
return res.choices[0].message.content
# ===== TTS =====
def tts(script):
with open("script.txt", "w", encoding="utf-8") as f:
f.write(script)
subprocess.run([
"edge-tts",
"--text-file", "script.txt",
"--voice", "en-US-AriaNeural",
"--write-media", "voice.mp3"
])
# ===== VIDEO =====
def create_video():
clip = VideoFileClip("assets/bg.mp4").subclip(0, 30)
audio = AudioFileClip("voice.mp3")
video = clip.set_audio(audio)
txt = TextClip("TRENDING NOW 🔥", fontsize=60, color='white')
txt = txt.set_position("center").set_duration(30)
final = CompositeVideoClip([video, txt])
output = f"output/video_{random.randint(1,9999)}.mp4"
final.write_videofile(output, fps=24)
return output
# ===== TITLE =====
def generate_title(keyword):
return f"{keyword} 🔥 Trending Now!"
# ===== DESCRIPTION =====
def generate_description(keyword):
return f"""
{keyword} is blowing up right now!
Learn how to use it before it's too late.
#trending #ai #makemoney
"""
# ===== MAIN =====
if __name__ == "__main__":
keyword = get_trend_keyword()
print("TREND:", keyword)
script = generate_script(keyword)
tts(script)
video = create_video()
title = generate_title(keyword)
desc = generate_description(keyword)
print("VIDEO:", video)
print("TITLE:", title)
print("DESC:", desc)
⚙️ 6. KEYWORDS FILE (VERY IMPORTANT)
Fill keywords.txt with trends from:
👉 VidIQ keyword insights
Example:
ai side hustle 2026
chatgpt赚钱方法
tiktok growth hack
youtube automation
make money with ai tools
🔄 7. n8n AUTO WORKFLOW (DAILY)
Flow:
Cron → Run Python → Upload → Save → Repeat
Import JSON:
{
"nodes": [
{
"parameters": {
"cronExpression": "0 */3 * * *"
},
"name": "Every 3 Hours",
"type": "n8n-nodes-base.cron",
"position": [200, 300]
},
{
"parameters": {
"command": "python main.py"
},
"name": "Run Trend Engine",
"type": "n8n-nodes-base.executeCommand",
"position": [400, 300]
}
],
"connections": {
"Every 3 Hours": {
"main": [[{ "node": "Run Trend Engine" }]]
}
}
}
📈 8. HOW YOU SCALE THIS
LEVEL 1:
- 1 channel
- 3 videos/day
- 3 channels
- 10 videos/day
- 5–10 channels
- 30–50 videos/day
💰 9. ADD MONEY LAYER
🔥 Traffic → Email
Use
👉 email automation system
🔥 SEO traffic
Use
👉 SEO optimization tools
🔥 Trend engine
Use
👉 VidIQ trend system
⚠️ 10. PRO TIPS (IMPORTANT)
- Change background video often
- Rotate voices
- Don’t reuse scripts
- Post consistently
🎯 FINAL RESULT
This system gives you:
✅ Auto trending content
✅ Daily video output
✅ Scalable traffic
✅ Monetization ready