Skip to main content

CLI & library that extracts YouTube captions and returns an OpenAI-generated summary

Project description

youtube-ai-resume

Generate concise AI summaries of YouTube videos from the command line.

It works in two steps:

  1. Downloads the video caption (subtitles) with pytubefix.
  2. Sends the caption to the OpenAI API and returns a summary in the language you choose.

PyPI Python Version License


Features

  • Zero-setup CLIyoutube-ai-resume <video_url>
  • Summaries in any language (default en_US)
  • Works with models like gpt-4.1-mini (configurable)
  • Rich-formatted output with colours
  • Usable as a library (import youtube_ai_resume)

Installation

# Python ≥ 3.9
pip install youtube-ai-resume

Or, from source for development:

git clone https://github.com/fberbert/youtube-ai-resume.git
cd youtube-ai-resume
pip install -e ".[dev]"     # editable + dev tools

Quick start

Command Line Usage

export OPENAI_API_KEY="sk-..."
youtube-ai-resume https://www.youtube.com/watch?v=Ht2QW5PV-eY

Sample output:

Summary:

The speaker, Dashish, an engineer on OpenAI’s product team, discusses advancements in AI agents that integrate improved models with powerful tools to 
enhance user experience. Key points include:

- **Symbiotic Improvement**: Better tools enable more capable AI agents, which in turn can utilize more powerful tools, creating a continuous cycle of 
enhancement.
- **Agent Capabilities**: The AI agent can access various personal tools and data sources, such as Gmail and Google Calendar, through connectors to perform
complex tasks.
- **Use Case - Booking a Tennis Tournament Itinerary**:
  - The agent is tasked with planning a detailed itinerary for a tennis tournament in Palm Springs, focusing on semi-final dates.
  - It checks the tournament schedule, the user’s calendar availability, flight options, hotel bookings, match attendance, and dining plans.
  - The agent uses a visual browser and personal data access to gather and coordinate all necessary information.
- **User Experience**: The agent automates the research and planning process, handling logistical details like travel time and meeting schedules, then 
notifies the user with a comprehensive plan to review.
- **Benefit**: This automation frees users from mundane tasks, allowing them to focus on the core activities they care about.

Overall, the presentation highlights how integrating AI models with personal data and external tools can create intelligent agents that manage complex, 
personalized planning tasks efficiently.

Library usage

from youtube_ai_resume import caption, summarizer

txt = caption.fetch_caption("Ht2QW5PV-eY")
summary = summarizer.summarize(
    transcript=txt,
    api_key="sk-…",
    model="gpt-4.1-mini",
    out_lang="en_US"
)
print(summary)

Configuration

Voice narration (Text-to-Speech) [Optional]

You can optionally have the summary narrated aloud using Google Cloud Text-to-Speech (TTS).

Optional Requirements (only if you want voice narration)

  • A service account key (JSON) with permission to use TTS
  • The dependencies google-cloud-texttospeech and playsound (already included in requirements.txt)

Optional Setup

  1. Create a project in Google Cloud and enable the Text-to-Speech API.
  2. Generate and download a service account credentials file (JSON).
  3. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your credentials file:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account.json"

The default path is ~/.config/youtube-ai-resume/.google-credentials.json. You can customize this path in your config file.

{
    "google_credentials": "~/.config/youtube-ai-resume/.google-credentials.json"
}

Usage

  • To hear the summary narration, add the --voice option to the command:
youtube-ai-resume --voice 'https://www.youtube.com/watch?v=Ht2QW5PV-eY'
  • To enable narration by default, add to your config.json:
{
    "voice_enabled": true
}

You can customize voice, language, and speed in config.json (see code examples).


You can set the OpenAI API key as an environment variable or in a config file.

Environment variable:

OPENAI_API_KEY="sk-..."

Config file at ~/.config/youtube-ai-resume/config.json (auto-created on first run) lets you change the default model.

{
    "model": "gpt-4.1-mini",
    "out_lang": "en"
}

Development

Contributions are welcome!

Fork ➜ branch ➜ PR.

ruff check . and pytest must pass.

Describe your change clearly.

License

Released under the MIT License – see LICENSE.

Author

Fabio Berbert fberbert@gmail.com

I am open for job opportunities and collaborations.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youtube_ai_resume-0.0.11.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youtube_ai_resume-0.0.11-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file youtube_ai_resume-0.0.11.tar.gz.

File metadata

  • Download URL: youtube_ai_resume-0.0.11.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for youtube_ai_resume-0.0.11.tar.gz
Algorithm Hash digest
SHA256 61308baa7e2bcd9f134da8c0241ad5c28c178f5fdae46e769e429ad599fa34bd
MD5 e6b9b16c1641e487cf11f0b3c9c9d5bf
BLAKE2b-256 2089dc166cb9f8bc4cee3fe08e2db97fae932c8a5bd7b93242a50c5c92cfbad2

See more details on using hashes here.

File details

Details for the file youtube_ai_resume-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_ai_resume-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 34736a6d7c48ff2bcb830627a4abce7e40a5002e9ff9c74050464841ba1f88d6
MD5 d83e9baa977a3dc0ee54b45a298c4856
BLAKE2b-256 7989f6af2f2838590b75faf4b146d252a556af34e90acd57c7cb7b945dc93388

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page