/youtube-scraper

Scripts for automating YouTube video transcripts, timecodes, summaries, and tags.

Primary LanguagePython


Logo Logo

YouTube Scraper

Scripts for automating YouTube video transcripts, timecodes, summaries, and tags.

Github

Table of Contents

    📝 About
    💻 How to build
    🚀 Next steps
    🔧 Tools used
    👤 Contact



📝 About

This project provides a set of Python scripts for automating YouTube video analysis. It includes functionality for extracting transcripts, generating summaries, creating tags, and identifying key topics with timecodes. The scripts utilize the YouTube Transcript API and OpenAI's GPT models to process and analyze video content.

💻 How to build

Note: macOS version, adjust accordingly for Windows / Linux

Initial setup

  1. Clone the repo.
  2. Copy .env.example and rename to .env:
OPENAI_API_KEY=your_openai_api_key_here
YOUTUBE_URL=https://www.youtube.com/watch?v=video_id_here
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

  1. Set the YOUTUBE_URL in your .env file to the desired YouTube video.

  2. Run the scripts:

  • For transcript extraction:

    python transcript.py
    
  • For summary and tags:

    python gpt.py
    
  • For topic timecodes:

    python timecode.py
    
  1. Check the output folder for the generated files.

Examples

Using this video from Fireship: https://www.youtube.com/watch?v=6xlPJiNpCVw

Fireship YouTube Video

For transcript extraction:

Fireship 1

For summary and tags:

Fireship 2

For topic timecodes:

Fireship 3

🚀 Next Steps

  • Implement error handling and input validation
  • Add support for batch processing multiple videos
  • Create a user-friendly command-line interface
  • Integrate with a web framework for a graphical user interface
  • Implement caching to reduce API calls and improve performance

🔧 Tools Used

Python OpenAI YouTube Transcript API

👤 Contact

Email Twitter