Skip to main content

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

Project description

youtube-ai-resume dQw4w9WgXcQ # Rick Astley demo 😄 txt = caption.fetch_caption("dQw4w9WgXcQ")

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_id>
  • Summaries in any language (default pt_BR)
  • 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 dQw4w9WgXcQ     # Rick Astley demo 😄

Sample output:

Summary:

• Rick distances himself from breaking promises
• Emphasises commitment (“never gonna give you up…”) …

Library usage

from youtube_ai_resume import caption, summarizer

txt = caption.fetch_caption("dQw4w9WgXcQ")
summary = summarizer.summarize(
    transcript=txt,
    api_key="sk-…",
    model="gpt-4.1-mini",
    out_lang="en"
)
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 Google Cloud account with the Text-to-Speech API enabled
  • 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"

Or authenticate using the Google Cloud CLI (gcloud):

gcloud auth application-default login

Usage

  • To hear the summary narration, add the --voice option to the command:
youtube-ai-resume dQw4w9WgXcQ --voice
  • 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.

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.5.tar.gz (7.5 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.5-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: youtube_ai_resume-0.0.5.tar.gz
  • Upload date:
  • Size: 7.5 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.5.tar.gz
Algorithm Hash digest
SHA256 0baf046e26aaaf57fa146ba5248a54229c79bbf20dea9fcc980ff02baff7b6c8
MD5 bc8a411940100073635d524d62bd4e74
BLAKE2b-256 185d482cb2dab14c927922e13695def6d6d4e666f52a0ef81a919f665cac2789

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for youtube_ai_resume-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6a326e79cb238262c181f55d7ff97da030afba5d47fe54d03cad29f43ef52313
MD5 203b7652d8f0cb083bafd978ae48386a
BLAKE2b-256 098ad30211a617ef670e6d7f94bc82299478fb20a2b8f77572cfc4688fa09a53

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