Skip to content

YouTube Playlist Topic Organizer - Automatically organize YouTube videos into topic-specific playlists using OpenAI

Notifications You must be signed in to change notification settings

malpern/playlistv3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Playlist Topic Organizer

A Python tool that automatically organizes videos from a source YouTube playlist into topic-specific playlists using OpenAI for content analysis.

Features

  • Analyzes video content using OpenAI's GPT models
  • Creates topic-specific playlists automatically
  • Handles duplicate videos intelligently
  • Efficient batch processing of playlist videos
  • Secure credential management

Requirements

  • Python 3.8 or higher
  • YouTube Data API v3 credentials
  • OpenAI API key
  • Required Python packages (see requirements.txt)

Installation

  1. Clone the repository:
git clone <repository-url>
cd youtube-playlist-organizer
  1. Install dependencies using uv:
uv venv
source .venv/bin/activate  # On Unix/macOS
.venv\Scripts\activate     # On Windows
uv pip install -r requirements.txt
  1. Set up credentials:

    • Copy .env.example to .env
    • Add your YouTube API credentials
    • Add your OpenAI API key
    • Configure other settings as needed
  2. Set up YouTube API:

    • Go to Google Cloud Console
    • Create a new project or select existing one
    • Enable YouTube Data API v3
    • Create OAuth 2.0 credentials
    • Download client secrets and save as client_secrets.json

Usage

Run the script with your source playlist URL and topics:

python main.py --playlist "https://www.youtube.com/playlist?list=YOUR_PLAYLIST_ID" --topics "topic1,topic2,topic3"

The script will:

  1. Authenticate with YouTube and OpenAI
  2. Analyze videos in the source playlist
  3. Create topic-specific playlists if they don't exist
  4. Add matching videos to appropriate playlists
  5. Skip any duplicate videos

Development

  • Code is formatted using black
  • Use pytest for running tests
  • Follow the implementation guide in IMPLEMENTATION.md

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

YouTube Playlist Topic Organizer - Automatically organize YouTube videos into topic-specific playlists using OpenAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages