Quote

Process description

This automation is a full-fledged intelligent system for automatically searching, analyzing and creating viral clips. The system automatically searches for trending videos through the YouTube API, analyzes their potential using AI, keeps a record of processed videos in Google Sheets, creates clips through Vizard AI, generates attractive titles and automatically publishes them to TikTok via Blotato.

API keys and services:

  1. YouTube Data API v3 - to search for trending videos
  2. Vizard AI API - for analyzing videos and creating clips
  3. OpenAI API Key - for AI content analysis and generation (gpt-4o-mini)
  4. Blotato API - for uploading media and publishing on social networks
  5. Google Sheets OAuth2 - to maintain a database of processed videos
  6. TikTok Account ID - for automatic publication (ID: 6545)

System architecture by blocks

SECTION 1: VIDEO SEARCH AND FILTER

1.1 When clicking 'Test workflow' - Manual launch

Purpose: Starts the process of searching for trending videos to create clips

Startup alternatives:

  • Manual Trigger for testing
  • Schedule Trigger to run automatically on schedule
  • Webhook for external integrations

1.2 HTTP Request2 — Search for trending YouTube videos

Purpose: Gets a list of the most popular YouTube videos through the official API

HTTP Request settings:

  • URL: https://www.googleapis.com/youtube/v3/videos
  • Method: GET
  • Query Parameters:
    • part: snippet, statistics, contentDetails
    • chart: MostPopular (top popular videos)
    • MaxResults: 50 (number of videos to analyze)
    • key: (Your API key)

What we get:

{

“items”: [

{

“id”: “dqw4w9wgxCQ”,

“snippet”: {

“title”: “Amazing viral moment!” ,

“description”: “This video shows incredible... “,

“ChannelTitle”: “Popular Channel”,

PublishEdat: 2024-01-15T 10:30:00 Z,

“categoryID”: “22"

},

“statistics”: {

“viewCount”: “1500000",

“LikeCount”: “85000",

“CommentCount”: “12000"

},

“ContentDetails”: {

“duration”: “PT5M30S”,

“caption”: “true”

}

}

]

}

1.3 Split Out1 - Video Splitting

Purpose: Converts an array of videos into separate elements for individual analysis

1.4 Filter - Filter by category

Purpose: Selects videos only from categories suitable for creating clips

Filtering conditions (OR logic):

  • CategoryID === “22" - People & Blogs (people and blogs)
  • CategoryID === “24" - Entertainment
  • CategoryID === “25" - News & Politics (news and politics)
  • CategoryID === “27" - Education
  • CategoryID === “28" - Science & Technology (science and technology)

Why filter categories:

  • Excludes music, games, sports (low potential for clips)
  • Focuses on content with high viral potential
  • Optimizes the quality of the source material

1.5 Code - Virus potential analysis

Purpose: Calculates the viral potential of each video based on metrics and content

Analysis algorithm:

1. Duration parsing:

//Convert ISO 8601 (PT5M30S) to minutes

const duration = video.contentDetails?. duration;

const DurationMatch = duration.match (/PT (? : (\ d+) H)? (? : (\ d+) M)? (? : (\ d+) S)? /);

const TotalMinutes = hours * 60+ minutes+seconds/60;

2. Freshness analysis:

//Check how long ago it was published

const PublishedDate = new Date (video.snippet?. PublishEdat);

const HoursDiff = (now - PublishedDate)/(1000 * 60 * 60);

3. Viral keyword detection:

const ViralKeywords = [

'shocking', 'amazing', 'incredible', 'unbelievable',

'must watch', 'viral', 'trending', 'insane',

'you won\'t believe', 'this will', 'watch this'

];

4. Virus score calculation:

const LikeRatio = likes/views;

const commentRatio = comments/views;

const ViralScore = LikeRatio * 1000+ CommentRatio * 5000+ (HasviralKeywords? 20:0);

Output data:

{

“id”: “dqw4w9wgxCQ”,

“title”: “Amazing viral moment!” ,

“VideoURL”: "https://www.youtube.com/watch?v=dQw4w9WgXcQ “,

“views”: 1500000,

“likes”: 85000,

“LikeRatio”: 5.67,

ViralScore: 45.2,

“hasviralKeywords”: true,

“TotalMinutes”: 5.5,

“HoursSincePublished”: 24

}

1.6 Code1 — Preparing data for AI

Purpose: Aggregates all analyzed videos and generates a prompt for AI selection

Prompt formation:

const AiPrompt = `Choose ONE of the most viral videos from the list:

1. Amazing viral moment!

URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ

Visningar: 1,500,000

Virus score: 45.2

2. Incredible transformation!

URL: https://www.youtube.com/watch?v=abc123

Visningar: 850,000

Virus Score: 38.7

Answer with a video number and justification. `;

SECTION 2: AI CHOOSING THE BEST VIDEO

2.1 AI Agent1 — Intelligent video selection

Purpose: AI analyzes the list of videos and selects the most promising one for creating clips

Connected components:

  • OpenAI Chat Model1 (gpt-4o-mini) - main language model
  • Simple Memory - memory for avoiding repetitions
  • Sheets - a tool for checking the database of processed videos
  • Structured Output Parser - structured JSON response

System prompt:

You're a TikTok content expert.

From the list of videos, choose ONE of the most viral ones.

IMPORTANT! Before choosing, use the Sheets tool to make sure that the selected video doesn't match and hasn't been used before.

Use the Sheets tool every time you start.

Be sure to make sure that the video has not been used before!

It is MANDATORY to reply ONLY in JSON format:

{

“videoURL”: “link to the selected video”,

“title”: “video title”,

“description”: “video description”

}

AI algorithm:

  1. Gets a list of videos with virality metrics
  2. Turns to Google Sheets to check for duplicates
  3. Analyzes the potential of each video
  4. Selects the best unused video
  5. Returns a structured JSON response

2.2 Sheets — Duplicate Checker Tool

Purpose: Allows AI to check whether a video has already been processed before

Settings:

  • Tool Description: “Video repetition test”
  • Document ID: (your document)
  • Sheet Name: (your document)

The structure of the accounting table:

date

Video

Status

clip

2024-01-15

https://youtube.com/watch?v=abc123

Done

clip1.mp4

2024-01-16

https://youtube.com/watch?v=def456

To do

-

2.3 Structured Output Parser - JSON parsing

Purpose: Provides a correct JSON response from AI

JSON Schema:

{

“VideoURL”: "https://www.youtube.com/watch?v=dQw4w9WgXcQ “,

“title”: “Example Video Title”,

“description”: “Example video description”

}

SECTION 3: DATABASE MANAGEMENT

3.1 Google Sheets2 - Adding to the database

Purpose: Writes the selected video to the database with the “To do” status

Speaker mapping:

  • Video: {{$json.output.videoURL}}
  • Date: {{$now}}
  • Status: “To do”

3.2 Google Sheets — Getting Tasks

Purpose: Reads videos with the “To do” status for processing

Filters:

  • Lookup Column: Status
  • Lookup Value: “To do”

3.3 Google Sheets3 — Status Update

Purpose: Changes status to “Done” after successful publication

Operation: AppendorUpdate Matching Columns: Video The fields to be updated are: Status = “Done”

SECTION 4: CREATING CLIPS

4.1 HTTP Request - Creating a Vizard Project

Purpose: Sends videos to Vizard AI to analyze and create clips

JSON Body:

{

“lang”: “en”,

“preferLength”: [0],

“videoURL”: “{{$json ['Video']}}”,

VideoType: 2,

“MaxClipNumber”: 8

}

4.2 Wait → HTTP Request1 → If - Waiting cycle

Logic: Similar to the first version - waiting 60 seconds and checking readiness

SECTION 5: CLIP PROCESSING

5.1 Edit Fields → Split Out → Limit

Purpose: Prepares clips for individual processing

Limit: Limits the number of clips that can be processed (the default is 1)

5.2 AI Agent - Generating descriptions

Purpose: Creates engaging titles and descriptions for TikTok

Updated prompt:

Clip title: {{$ ('AI Agent1') .item.json.output.title}}

Description: {{$ ('AI Agent1') .item.json.output.description}}

Transcription: {{$json.videos.transcript}}

Viral reason: {{$JSON.videos.ViralReason}}

Benefit: AI uses data from both Vizard and YouTube to describe it more accurately

SECTION 6: PUBLICATION

6.1 Set Accounts → Upload → TIKTOK

Logic: Similar to the first version - uploading to Blotato and posting to TikTok

Update to Set Accounts:

{

“video_caption”: “{{json.stringify ($json.output) .slice (1, -1)}}”

}

Node connection diagram

Main stream:

  1. Manual TriggerHTTP Request2 (YouTube video search)
  2. HTTP Request2Split Out1FilterCodeCode1
  3. Code1AI Agent1 (choosing the best video)
  4. AI Agent1Google Sheets2 (database entry)
  5. Google Sheets2Google Sheets (reading tasks)
  6. Google SheetsHTTP Request (creating clips)

Clip processing:

  1. HTTP RequestWaitHTTP Request1If
  2. If (True) → Edit FieldsSplit OutLimit
  3. LimitAI AgentSet AccountsUploadTIKTOK
  4. TIKTOKGoogle Sheets3 (status update)

AI connections:

  • OpenAI Chat Model1 + Simple Memory + Sheets + Structured Output ParserAI Agent1
  • OpenAI Chat ModelAI Agent

Required services and their settings

YouTube Data API setup:

  • Create a project in Google Cloud Console
  • Enable YouTube Data API v3
  • Get the API key: (your API key from google cloud console)

Setting up Google Sheets:

  • Create a “Video Accounting for Clips” table
  • ID: Your spreadsheet ID
  • Speakers: Date, Video, Status, Clip
  • Set up OAuth2 access

Other services:

  • Vizard AI, Blotato, OpenAI - similar to the first version

New features of the v2.0 system

Automatic content search:

  • YouTube API integration - search for the most popular videos
  • Category filtering - only suitable content types
  • Virality metrics - capacity calculation based on statistics
  • Keywords - detection of viral patterns in headlines

Intelligent selection:

  • AI video selection - analysis of all candidates simultaneously
  • Prevent duplicates - checking the database of processed videos
  • Structured answers - guaranteed JSON format
  • System memory - avoid re-selection

Database and accounting:

  • Google Sheets integration - full accounting of all transactions
  • Processing statuses - To do/Done for process control
  • Transaction history - date, video, result
  • Automatic update - statuses change automatically

Improved content generation:

  • Dual context - data from YouTube+ Vizard
  • More accurate descriptions - AI knows the source and content
  • Optimization for TikTok - specific formats and trends

Application of the v2.0 system

To automate content production:

  • Full autonomy - from search to publication without human intervention
  • Daily publications - setting Schedule Trigger to run regularly
  • High-quality filtration - only verified sources are processed
  • Eliminate duplicates - each video is only processed once

For agencies and studios:

  • Scalable search - analysis of 50 top videos at a time
  • AI expertise - objective selection of the best candidates
  • Systematization of the process - full control via Google Sheets
  • Optimizing ROI - focus only on the most promising videos

The result of the v2.0 system

What happens is:

  • Intelligent content pipeline with AI source selection
  • Automatic trend search via YouTube API
  • Excluding the human factor in choosing content
  • Full transparency of the process through the accounting system
  • Guaranteed uniqueness content

Performance metrics v2.0:

  • Analysis: 50 trending videos per launch
  • Filtering: only 5 relevant categories
  • AI choice: 1 best video out of all candidates
  • Preventing duplicates: 100% uniqueness
  • Full cycle: from search to publication in 2-3 minutes

The advantages of v2.0 over v1.0:

  • Autonomy - no need to manually search for videos
  • Quality of sources - only trending YouTube videos
  • AI expertise - objective analysis of potential
  • Systematicity - full accounting and control of the process
  • Scalability - easy to increase the number of analyzed videos

The v2.0 system turns viral content creation into a fully automated and intelligent process!

Читайте также