Skip to content

avabb0916/Media_Analysis_Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Media Analysis Lab

Decode the style DNA of top creators. Turn "feeling" into "formula".

Media Analysis Lab is a tool that analyzes YouTube channels to extract actionable insights about their positioning, visual style, and engagement strategies. It uses Google Gemini AI to generate "Style DNA" reports.

Features

  • Channel Analysis: Fetches channel stats, recent videos, and top comments via YouTube Data API.
  • Positioning Diagnosis: Evaluates how well a user's self-positioning matches a target channel's persona.
  • Style DNA Decoding: Extracts visual keywords, title formulas, and engagement hooks.
  • Mock Mode: Built-in demo mode to experience the features without using real API quotas.

Tech Stack

  • Backend: FastAPI (Python), Google Gemini API (google-generativeai), YouTube Data API v3.
  • Frontend: Next.js 14, React, Tailwind CSS, Lucide Icons.

Prerequisities

  1. Python 3.9+
  2. Node.js 18+
  3. Google Cloud Project with:
    • YouTube Data API v3 enabled.
    • Generative Language API (Gemini) enabled.

Setup & Installation

1. Clone the repository

git clone <repository-url>
cd Media_Analysis_Lab

2. Backend Setup

cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Create a .env file in backend/ (see .env.example if available, or use the format below):

# backend/.env
PROJECT_NAME="Media Analysis Lab"
BACKEND_CORS_ORIGINS=["http://localhost:3000"]
GEMINI_API_KEY=your_gemini_key_here
YOUTUBE_API_KEY=your_youtube_key_here
ENABLE_MOCK_AI=false

3. Frontend Setup

cd ../frontend
npm install

Running the Application

We provide a convenient start script to launch both servers:

# In the root directory
./start.sh

Usage Guide

  1. Open http://localhost:3000.
  2. Enter a YouTube Handle (e.g., @LiZiqi).
  3. (Optional) Enter your own positioning to see a match score.
  4. Enter your API Keys (or configure them in .env).
  5. Click Analyze.

Mock Mode (Demo)

If you strictly want to test the UI or don't have active API quotas, you can enable Mock Mode:

  • Method 1: Set ENABLE_MOCK_AI=true in backend/.env and restart the server.
  • Method 2: If the API returns a 429 Quota Exceeded error multiple times, the system will automatically fallback to Mock Mode for that request.

Troubleshooting

  • 404 Channel Not Found: Ensure you are using the precise Handle (e.g., @Handle).
  • 429 Quota Exceeded: The system will retry automatically. If it persists, try Mock Mode or check your Google Cloud billing status.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages